Selenium with Python phantomjs or other workaround

Hello,
Initially I made a script that used selenium and Firefox. However, realising that it didn’t work with Glitch I tried to change to PhantomJs. But I can’t find a way to install it. pnpm gives /usr/bin/env: ‘node’: No such file or directory and I can’t create a package.json because my project is in python. With Firefox, Chrome or PhantomJS it’s the same for me as long as it works

@17lwinn is the Python guy who can help you out.

greetings!

have you tried a CDN?

No, what is that and how can I make it work?

a CDN stands for Content Delivery Network, this is a way to import external scripts and stylesheets from providers like microsoft or google.

For nodejs, there are services like JSdelivr that lets you use node through their CDN.

to use it, paste the following below your <head> tag:

<script src="https://cdn.jsdelivr.net/npm/phantomjs@2.1.7"></script>


once you import it, your done! you have phantomjs in your page.

Hm I see, but I dont have any html tag. I only have a .py file

perhaps you should try this with a flask starter? that way you can use python and HTML at the same time

then you can add the line i sent

you would add the line above the <head> tag

Ok thanks, I will try it

Hello, I have read the project you sent but I don’t think it fits what I’m looking for. I just need PhantomJS to act as a browser so I can take a page screenshot.
Thanks

I have an idea, open a node project and copy your code into there. That’s really the only solution at the moment