简体   繁体   English

如何使用 Javascript 中的表格构建网站

[英]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.我想用 Powershell 抓取网站表,但我发现这个网站正在用 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.这是网站: https://www.gunzodus.net/auction我想用 header “待售字符”来刮桌子,但正如你在源代码中看到的,这个表是用 ZDE9ZDCEEFF9ED78E2EE2E 生成的标准 Powershell Invoke-Webrequest $url & select 表 # 不起作用。 Does anyone know how to extract the javascript from the sourcecode?有谁知道如何从源代码中提取 javascript? I see there is a javascript that starts with "var sellCharactersData".我看到有一个以“var sellCharactersData”开头的 javascript。 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"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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