Click on button in form not working


I am trying to setup a crawler that logs in to a website.
My code fills out the username and password in the form correctly, but I cannot get it to click on the submit button. I’ve tried several versions of .submit() and .click(), but nothing seems to happen.

HTML source:

Crawler code (not working):

Any suggestions?


Hi @Historisk_Dragter,

You probably need to wait a little after you click on button. But it depends on website. If it is SPA it should work but, if there is any redirect, crawler will try to add redirected page to queue. You can see what happens in log.

Anyway there are better way how you can log into website:

  1. Copy cookies from browse -
  2. Use Apify actor, which is more generic solution for creating web crawler - There is one example how you can log into website using the actor. -