How can I get dynamically web content using Perl?

后端 未结 2 1696
悲&欢浪女
悲&欢浪女 2021-01-07 03:58

This is kind of tricky. There is this webpage which, I am guessing, uses some kind of AJAX to pull out content based on the search query. When I fetch the page using get in

2条回答
  •  走了就别回头了
    2021-01-07 04:05

    Take a look at Selenium RC and the WWW::Selenium module in Perl. With them you can control a real web browser.

    Another option is WWW::HtmlUnit which uses the HtmlUnit Java library to execute the JavaScript without a web browser. WWW::HtmlUnit uses Inline::Java to give Perl access to the library. I have found that when installing, it is best to say No to the question "Do you wish to build the JNI extension?".

提交回复
热议问题