Sean Kirby
Sean Kirby

Reputation: 9

Would like to follow javascript link using MechanicalSoup follow_link() or similar

I would like to follow the link

<a href="javascript: GFESubmitForm('credit-report-quotation-report.do')">› Credit Quotation</a>

using the follow_link() method or similar in the StatefulBrowser package

Using

browser.follow_link("javascript: GFESubmitForm('credit-report-quotation-report.do')")

causes erros

mechanicalsoup.utils.LinkNotFoundError

Any help would be much appreciated

Upvotes: 1

Views: 854

Answers (1)

Daniel Hemberger
Daniel Hemberger

Reputation: 216

Since MechancialSoup doesn't support JavaScript, you can either try to manually reconstruct the request if you know what the JavaScript is doing, or use a tool that simulates a fully-fledged browser (and thus includes JavaScript support) such as Selenium.

These options are described in the MechanicalSoup FAQ here.

Good luck!

Upvotes: 1

Related Questions