Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

345
Views
File chooser dialog can only be shown with a user activation error while using web scraping through Javascript

I am trying to programmatically click a button in a web page using the command

document.getElementsByName("versionFile")[0].click()

while this command works fine in the developer tool console (opens the file selector) i am not able to execute this in script because it gives me a error saying "File chooser dialog can only be shown with a user activation" highlighting the click() function

Can anyone hep me out with this.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Most modern browsers restrict the JavaScript interactions not started by the user, to avoid annoying pages and make XSS a bit more difficult.

If you are using a web-scraping library like puppeteer, you should interact with the page using it's API (using page.click for example), not by injecting JavaScript on the page.

If that is not a option, you need to find the callback function that the button fires, and bypass the element.click() method.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!