How to skip A4J. Ajax.Submit through php curl

2020-07-28 06:44发布

问题:

I am trying to scrap the internal pages of a java .jsf extention pages through php curl. I have used curl and login the website after that i have reached listing page . in the listing page item ids are give and after clicking the link item detail shows in pop. My problem is on the listing page the url is somthing like this

<a style="font-weight:normal;"    onclick="A4J.AJAX.Submit('_viewRoot','requirementDetails:requirementDetailsPage',event,{'oncomplete':function(request,event,data)

{RequirementPage.show();document.getElementById('formName').focus();},
'parameters': {'requirementDetails:requirementDetailsPage:req:1:_idJsp383':'requirementDetails:requirement     DetailsPage:req:1:_idJsp383'} ,




'actionUrl':'/test/myweb/baRequirementDetailsHome.jsf'} );return false;"    ="requirementDetails:requirementDetailsPage:req:1:_idJsp383"   id="requirementDetails:requirementDetailsPage:req:1:_idJsp383" href="#">3922704</a>  

Now how to go the item detail page the action url is same as the current page on clicking the link a pop up occurs with all detail. Please help how to proceed to the detail page. How to handle with A4j.AJAX.Submit.

and response is showing like this :
POST /gbams/vendorPages/baRequirementDetailsHome.jsf AJAXREQUEST=_viewRoot&requirementDetails%3ArequirementDetailsPage%3Acheck=false&requirementDetails%3ArequirementDetailsPage%3Acheck=false&requirementDetails%3ArequirementDetailsPage%3AreqIDAutoHidden=autoReqIDHidden&requirementDetails%3ArequirementDetailsPage%3AreqIDAutoHidden=autoReqIDHidden&requirementDetails%3ArequirementDetailsPage%3ArequireType=current&requirementDetails%3ArequirementDetailsPage%3AskillAutoHidden=autoSkillHidden&requirementDetails%3ArequirementDetailsPage%3ArequireTypeSkill=current&requirementDetails%3ArequirementDetailsPage%3AlocAutoHidden=autolocHidden&requirementDetails%3ArequirementDetailsPage%3ArequireTypeloc=current&requirementDetails%3ArequirementDetailsPage%3A_idJsp361=All&javax.faces.ViewState=rO0ABXVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAANzcgBHb3JnLmFwYWNoZS5teWZhY2VzLmFwcGxpY2F0aW9uLlRyZWVTdHJ1Y3R1cmVNYW5hZ2VyJFRyZWVTdHJ1Y3RDb21wb25lbnRGWRfYnEr2zwIABFsACV9jaGlsZHJlbnQASltMb3JnL2FwYWNoZS9teWZhY2VzL2FwcGxpY2F0aW9uL1RyZWVTdHJ1Y3R1cmVNYW5hZ2VyJFRyZWVTdHJ1Y3RDb21wb25lbnQ7TAAPX2NvbXBvbmVudENsYXNzdAASTGphdmEvbGFuZy9TdHJpbmc7TAAMX2NvbXBvbmVudElkcQB&equirementDetails%3ArequirementDetailsPage%3Areq%3A1%3A_idJsp383=requirementDetails%3ArequirementDetailsPage%3Areq%3A1%3A_idJsp383&autoScroll=&requirementDetails%3ArequirementDetailsPage%3AreqIDAuto=&requirementDetails%3ArequirementDetailsPage%3AskillAuto=&requirementDetails%3ArequirementDetailsPage%3AlocAuto=&requirementDetails%3ArequirementDetailsPage%3A_idJsp326=&re%3A_idJsp31%26requirementDetails%3ArequirementDetailsPage%3A_link_hidden_=&requirementDetails%3ArequirementDetailsPage%3A_idcl=&requirementDetails%3ArequirementDetailsPage%3A_idJsp460=&requirementDetails%3ArequirementDetailsPage%3Areq%3A6%3A_idJsp383=requirementDetails%3ArequirementDetailsPage%3Areq%3A6%3A_idJsp383&

回答1:

Use Ruby with watir web driver to skip ajax submit browser = Watir::Browser.new :firefox browser.goto 'url'

 browser.goto '

 #browser.execute_script('arguments[0].removeAttribute("disabled");',
 browser.html)
 doc = Nokogiri::HTML(browser.html)