In PhontomJs I want to Page automate this particular page https://exclusions.oig.hhs.gov/ I can able to open this page and I can able to enter the values in the fields and after clicking this page I'm getting multiple search results having multiple results in a table i need to go through each and every link(in this page the href's are in the form of _dopost methods I'm not able to get exact links, so I must & should to click the particular anchor element) of the displayed page and do some comparison operation in next child pages.I must and should able to click all the links in the search result
在PhontomJs我想要页面自动化这个特定的页面https://exclusions.oig.hhs.gov/我可以打开这个页面,我可以在字段中输入值,点击此页面后,我得到多个在表格中有多个结果的搜索结果我需要遍历每个链接(在此页面中,href是_dopost方法的形式我无法获得确切的链接,所以我必须&应该点击特定的锚点显示页面的元素,并在下一个子页面中进行一些比较操作。我必须并且应该能够点击搜索结果中的所有链接
Please help me...!!! Thanks in advance
请帮我...!!!提前致谢
1 个解决方案
#1
0
Should be something like (assuming you use jQuery):
应该是这样的(假设你使用jQuery):
page.open('https://exclusions.oig.hhs.gov/ ', function(status) {
//Do the search
var links = page.evaluate(function(s) {
//Refine this selector so you only get the links you want
return document.querySelector("a");
});
//loop through links
$.forEach(links, function(link){
$(link).click();
//Do stuff on the page
})
});
#1
0
Should be something like (assuming you use jQuery):
应该是这样的(假设你使用jQuery):
page.open('https://exclusions.oig.hhs.gov/ ', function(status) {
//Do the search
var links = page.evaluate(function(s) {
//Refine this selector so you only get the links you want
return document.querySelector("a");
});
//loop through links
$.forEach(links, function(link){
$(link).click();
//Do stuff on the page
})
});