开发者

Perl see the full content in response

I need to take data from html page, so I am using LWP to get the page content. the response I got is partial and not the full source of the page.

...

<div style="display:none" id="QUERY" query=""></div>
<div style="display:none" id="COLL" idcoll=""></div>
<div style="display:no开发者_如何学Cne" id="BROWSE" field=""></div>

<div id="center"></div>
<div id="loading"></div>

...

when using a web debugger(FIRE BUG) I can see a hidden content under:

<div id="center"></div>
<div id="loading"></div>

How can I get the hidden data using Perl ?

It breaks my mind for 3 days now ! Thanks ahead.


let's say it a JS running... How can i see the content?

You could use WWW::Mechanize::Firefox. It seems to support Javascript.


If the content is indeed added using Javascript, you might be able to use WWW::Scripter with the Javascript or Ajax plugin.


If it is not present in the HTML source that LWP fetches, it is added in some other way. There probably is a Javascript running, or the webserver serves you and LWP different pages because of cookies or user agent string.


Install Firebug or use the Safari Develop menu to see what AJAX/XHR requests are being done to the server, and with what POST/GET parameters. You can then use LWP or any other HTTP client module to do such a request.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜