简体   繁体   English

如何获取AJAX生成的HTML文本?

[英]How to get AJAX generated HTML text?

AJAX is a very powerful tool so I am struggling with it :-). AJAX是一个非常强大的工具,因此我正在努力解决它:-)。

Is there any way or API(in java) so that I can get the HTML code which is generated by AJAX? 有没有什么办法或API(java中),以便我可以获得AJAX生成的HTML代码?

Generally, AJAX make use of inner HTML code and hence this inner HTML code is missing when I look into the page source of a page. 通常,AJAX使用内部HTML代码,因此当我查看页面的页面源代码时,会丢失此内部HTML代码。

eg click here 例如点击这里

Just see the section OTHER NEWS . 只需查看OTHER NEWS部分。 The content is populated by AJAX. 内容由AJAX填充。 When I look into the page source the code is not there. 当我查看页面源代码时,代码不存在。

I need this HTML code through a java program. 我需要通过Java程序获取此HTML代码。 How can I get it? 我怎么才能得到它?

To have a Java application use the content received via AJAX, you need to first find the URLs from where the content is getting called from. 要使Java应用程序使用通过AJAX接收的内容,您首先需要找到从中调用内容的URL。 In case this it would be http://itm2083.com/get_wwo_content.php?featureGroupId=8355&featureDisplayLimit=1&sponsorName=vortalx&wwoDivCounter=5&domainUrlForWWo=http://item2083.com/&featureImgDisplay=FLAG_TRUE&featureGroupImageWidthLimit=200&featureGroupDefaultImageUrl1=http://wwo.itmftp.com/75x75.gif&featureGroupDefaultImageUrl2=http://wwo.itmftp.com/75x75.gif&featureGroupDefaultImageUrl3=http://wwo.itmftp.com/75x75.gif 万一这是http://itm2083.com/get_wwo_content.php?featureGroupId=8355&featureDisplayLimit=1&sponsorName=vortalx&wwoDivCounter=5&domainUrlForWWo=http://item2083.com/&featureImgDisplay=FLAG_TRUE&featureGroupImageWidthLimit=200。 COM / 75x75.gif&featureGroupDefaultImageUrl2 = HTTP://wwo.itmftp.com/75x75.gif&featureGroupDefaultImageUrl3=http://wwo.itmftp.com/75x75.gif

The featureGroupId= parameter has 5 IDs: 8355, 8359, 8367, 8369, 8429. Use these to pull the content from the Other News box. featureGroupId =参数具有5个ID:8355、8359、8367、8369、8429。使用这些ID从“其他新闻”框中提取内容。

The featureDisplayLimit= parameter determines how much content is pulled from the server. featureDisplayLimit =参数确定从服务器提取多少内容。

If you want the nice HTML as well, the Java app will have to recreate it, as the HTML rendered on the site is created by JavaScript code. 如果您还需要漂亮的HTML,则Java应用程序将不得不重新创建它,因为网站上呈现的HTML是由JavaScript代码创建的。

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

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