DEV Community

KoichiArai
KoichiArai

Posted on

1

Day22 of 100DaysOfCode

I'm still working on scraping tasks.
During these tasks, I've picked up a few techniques for specific situations, and I'm nothing them down for future reference.

What I learned

  • It's better to use the method .click() when the targeted element has an attribute like href="Javascript:~". This ensures the click action is properly triggered.

  • When you want to input text into a pre-filled textbox, clear it first by using:

await page.$eval("selector", element => element.value = "")

This will help avoid appending text to the existing value.

  • The method page.waitForTimeout doesn't exist. In fact, .waitForTimeout is deprecated and shouldn't be used.

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay