dimanche 31 juillet 2016

Scrapy get through ASPNet accept dialog using Javascript link

Here is the form on a Accept.aspx that I am trying to get through:

<form name="aspnetForm" method="post" action="Accept.aspx" id="aspnetForm">
    <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTEwMDUyNjYzMjhkZH2Bd9lP6b10lpPKBuDrSTFYUEXj" />
    <input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="7D7EA99C" />
    <p class="content" style="text-align:center;"> 
        I have read and understood the above.
    </p>
    <p class="content" style="text-align:center;"> 
        <a href="http://ift.tt/2aHB5jm" >Click here to enter the site</a>
    </p>
</form>

What I have so far, but doesn't set the cookie:

yield FormRequest.from_response(
        response,
        formname='aspnetForm',
        callback=self.after_accept
)

When I inspect the request using the actual page no form data is sent. It's seems to be a straight forward GET request. In my after_accept function I get the Accept.aspx page back instead of List.aspx.

Any pointers would be helpful.




Aucun commentaire:

Enregistrer un commentaire