开发者

Access text generated with javascript

开发者 https://www.devze.com 2023-02-18 01:25 出处:网络
This website has a custom google search box: http://ezinearticles.com/ The search results are generated by a piece of JS code. How would I acces开发者_开发技巧s these results using wget and/or C#\'

This website has a custom google search box:

http://ezinearticles.com/

The search results are generated by a piece of JS code. How would I acces开发者_开发技巧s these results using wget and/or C#'s WebClient?


It looks like the searches on that page are normal google site searches. Try wget with the following url, where 'asdf' is your search

wget http://www.google.com/search?&q=site:ezinearticles.com+asdf


You need to to what your web browser does - render the page. Maybe you can extract the js call to the webservice providing the results and just execute this request and parse the output directly.


You need to access it with a programmable browser supporting JavaScript.

  • The HtmlUnit library for Java does this, and runs fine headless.
  • You can automate a real web browser, e.g. with WatiN on Windows, and access the page's content. This requires a GUI desktop though, because a real browser window is opened.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号