mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 06:37:46 +00:00
Update scraping.nu
Updated `selector` syntax to account for flag changes Simplified parsing by passing multiple css selectors to `selector`
This commit is contained in:
parent
3f44d7238b
commit
85197f93c7
1 changed files with 5 additions and 5 deletions
|
@ -2,9 +2,9 @@
|
|||
let baseurl = 'https://www.schiit.co.uk/'
|
||||
let pages = [headphone-amps dacs schiit-gaming-products power-amplifiers preamps upgrades accessories-cables schiit%20graded%20stock]
|
||||
$pages|each {
|
||||
fetch (build-string $baseurl $it)|selector 'div.caption' -a|each {
|
||||
echo ($it|selector 'p.stock') (echo $it|selector 'h5'|str trim)|
|
||||
rotate name availability|
|
||||
reject Column2
|
||||
fetch (build-string $baseurl $it)|selector -q 'div.caption' -m|each {
|
||||
$it|selector -q 'p.stock, h5'|str trim|
|
||||
rotate counter-clockwise t name availability|
|
||||
reject t
|
||||
}
|
||||
}
|
||||
}|sort-by availability
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue