2

I need to fill a form aproximately 100 times a day. I tried with selenium but it is quite slow because it is using a web browser. It's working quite well with mechanicalsoup until I need to click "Accept" button. Clicking it activates other tables that need to be filled but are inactive before clicking this button. I tried to point to the button and then br.follow_link(button) unsuccesfully. I attach the piece of HTML that I need to fake. I'm looking for a way to produce the effect of clicking avoiding using Selenium.

Aceptar

Cmb
  • 31
  • 4

1 Answers1

0

Sounds like you need JavaScript capability so the button's click would render the tables, but MechanicalSoup doesn't do Javascript.

MechanicalSoup's docs says:

MechanicalSoup automatically stores and sends cookies, follows redirects, and can follow links and submit forms. It doesn’t do Javascript.

Khalid Ali
  • 1,224
  • 1
  • 8
  • 12
  • Thank you for your answer. Since it is just a small problem i thought there might be a way to fake the click sending the instruction generated by clicking as it is suggested in this answer. https://stackoverflow.com/a/39964061/11385987. There is also this other suggestion with request and sessions... https://www.reddit.com/r/learnpython/comments/6bt8g2/how_can_i_essentially_click_a_button_on_a_webpage/ – Cmb Apr 20 '19 at 07:44