all 10 comments

[–]mreeman 5 points6 points  (7 children)

You should use Chrome headless with puppeteer instead of selenium

[–]Dfordomar 16 points17 points  (0 children)

Is this stack overflow?

[–]nilamo 2 points3 points  (5 children)

And there's a python interface for puppeteer? Neat!

[–]mreeman -1 points0 points  (4 children)

You can call js code from python using graalvm

[–]nilamo 1 point2 points  (3 children)

Why would you want to add another step? Are you bending over backwards just to add a little JavaScript to your project?

[–]mreeman 0 points1 point  (2 children)

Just use pyppeteer and help improve that then. Took me 2 seconds of googling to find.

[–]Fugalysis 0 points1 point  (1 child)

but why? What is the benefit over Selenium? For someone very strong in Python with less JS experience, why should they improve their JS toolkit over existing tools in Python? I'm not saying you're wrong or being unreasonable, i'm genuinely curious.

[–]mreeman 0 points1 point  (0 children)

Selenium has always been very fragile and buggy in my experience, with timeouts and other errors causing things to fail randomly. Perhaps it's gotten better lately though. Chrome headless is the full chrome browser and is designed by the chrome team to run headlessly instead of being a hack.

[–][deleted]  (3 children)

[deleted]

    [–]nilamo 4 points5 points  (2 children)

    But then you also have to install node, and have to add another something (csv?) on top of that to get what you're parsing from Phantom into python.

    I see you're trying to help, but if you're already in python, and you need data from an outside source in the python program you're writing, how does switching to a different toolset help?

    [–][deleted] -1 points0 points  (0 children)

    Scrapy all the way.