Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itz-fork/vrawler
Helper functions for web scraping in V (vlang)
https://github.com/itz-fork/vrawler
v vlang vlang-module web-scraping
Last synced: about 1 month ago
JSON representation
Helper functions for web scraping in V (vlang)
- Host: GitHub
- URL: https://github.com/itz-fork/vrawler
- Owner: Itz-fork
- License: mit
- Created: 2023-11-26T03:31:18.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-11-30T18:52:56.000Z (about 1 year ago)
- Last Synced: 2023-12-01T19:38:17.572Z (about 1 year ago)
- Topics: v, vlang, vlang-module, web-scraping
- Language: V
- Homepage:
- Size: 10.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Vrawler
Some helper functions that I use to scrape websites### Retrive by selectors
Used to retrive html elements using css selectors- Function: `from_selector`
- Arguments:
- `hdoc`: html document as a string (if parsed convert to str with `parsed.str()`)
- `selectors`: string of css selectors (Ex: `#myid > p > a:nth-child(1)`)Example
```htmlTest file
```
```v
import vrawlerfn main() {
// Suppose this index.html == above html
html_str := read_file('/home/scraped/mysite/index.html')
spn := vrawler.from_selector(html_str, '#mydiv > a:nth-child(2) > span')
println(spn)
}// stdout
// [V]
```