Welcome to the MMOLEARN.COM

Build your first Dropshipping, Online Course, Affiliate, Blog, Business, Optin, etc, WEBSITE and make money with us. We offer over 10.000+ Wordpress Plugins & Themes which will let you build ANYTHING. Plus we have nice community which likes to gossip about building websites and making some money online! Its really easy to do when we have everything you need to BUILD anything you WANT. Hope you enjoy your stay and have a beautiful day with us!

or Register
gifd

MMO P&S Selenium help required , extension and headless browser...

zuanchakma

New member

Reputation: 1%
Joined
Dec 3, 2023
Messages
6
Reaction score
0
Points
1
Hello,

I've been attempting to create a headless scraper with an extension. The scraping process functions smoothly when the browser is not in headless mode. Both browsers are configured with a profile that includes the installed extension. I'd consider abandoning the extension, but the challenge lies in dynamic variables affecting the elements. Identifying the right element to extract data from the site has proven elusive.

Chromedriver: It appears that extensions are not supported in headless mode with Chrome, or at least I haven't discovered a solution yet.

Geckodriver: While extensions work with headless mode, the issue arises when text is placed on the clipboard, and it seems the clipboard is not shared from headless mode to the host machine.

Are there alternative solutions on Windows to enable scraping in headless mode? Any insights would be appreciated.
 

Upilword

Active member

Reputation: 31%
Joined
Jun 11, 2019
Messages
247
Reaction score
24
Points
35
Hello,
Are there alternative solutions on Windows to enable scraping in headless mode? Any insights would be appreciated.

Why use browser emulation when you can make direct HTTP requests with PHP, Python, and other languages?
 

zuanchakma

New member

Reputation: 1%
Joined
Dec 3, 2023
Messages
6
Reaction score
0
Points
1
Why use browser emulation when you can make direct HTTP requests with PHP, Python, and other languages?

I’m not skilled enough to get the data because the element names keep changing, and I always end up with the wrong results.

I found a browser extension that works every time and gives me exactly what I need from the page. But I’ll try using requests again since I know that would be a cleaner solution.
 

SummersBase

Active member

Reputation: 25%
Joined
Jul 24, 2020
Messages
144
Reaction score
64
Points
42
Why does the browser need to be in headless mode? I usually use Selenium when I need to scrape data. If you share some details with me, I might be able to help.
 

zuanchakma

New member

Reputation: 1%
Joined
Dec 3, 2023
Messages
6
Reaction score
0
Points
1
Why does the browser need to be in headless mode? I usually use Selenium when I need to scrape data. If you share some details with me, I might be able to help.

I use it on my regular computer for other work, and it’s annoying when the browser popups. I was hoping to run it separately from the clipboard, because if I or the script copy something, it can mess things up. So, I’ve just been leaving it running at night so it doesn’t bother me.
 

SummersBase

Active member

Reputation: 25%
Joined
Jul 24, 2020
Messages
144
Reaction score
64
Points
42
I use it on my regular computer for other work, and it’s annoying when the browser popups. I was hoping to run it separately from the clipboard, because if I or the script copy something, it can mess things up. So, I’ve just been leaving it running at night so it doesn’t bother me.

Ah, I get it now. So you can run Selenium in headless mode—what do you need the extension for then?
 

zuanchakma

New member

Reputation: 1%
Joined
Dec 3, 2023
Messages
6
Reaction score
0
Points
1
Ah, I get it now. So you can run Selenium in headless mode—what do you need the extension for then?

The extension extracts data from SERPs because I can't do it with find_elements. There are so many dynamic variables, and I'm not sure how to find the right elements. I know it's possible with XPath axes like following-sibling or descendant, but those are too advanced for me, and I haven’t had time to learn them.
 

Oakwordue

Member

Reputation: 6%
Joined
Dec 25, 2022
Messages
49
Reaction score
0
Points
6
Extensions in Chrome don't work with Selenium in headless mode. I’d suggest not using headless if you need the extensions.
 
Top Bottom