简体   繁体   中英

How to scrape website with table build in Javascript

I'd like to scrape a websites table with Powershell but I found out this website is building the table with a javascript. This is the website: https://www.gunzodus.net/auction And I'd like to scrape the table with the header "Characters for Sale", but as you can see in the source this table is generated with javascript so the standard Powershell Invoke-Webrequest $url & select the table # won't work. Does anyone know how to extract the javascript from the sourcecode? I see there is a javascript that starts with "var sellCharactersData". If I could only extract this line I could parse this line further in the script.

Well there is probably a better way but for now I solved it by using this:

$web = Invoke-WebRequest "https://www.gunzodus.net/auction"
$web.tostring() -split "[`r`n]" | select-string "sellCharactersData"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM