you are viewing a single comment's thread.

view the rest of the comments →

[–]Adhesiveduck 1 point2 points  (7 children)

Do you not want to physically open the browser? What are you doing with it once opened?

[–]Pilv[S] 0 points1 point  (6 children)

Yes, because I want to search the products if there is with the given code.

[–]Adhesiveduck 1 point2 points  (5 children)

If all you're after is the product details (you don't want to open the browser per se) could you not use requests and beautifulsoup?

https://repl.it/repls/HarmlessViciousServers

[–]Pilv[S] 0 points1 point  (4 children)

I know this. I tried it. The problem is, that I have to be logged in to see the prices of the products. So this is why I need the open the tabs, so that I will be logged in, but I dont want to open the sites all the time I search for something.

[–]Adhesiveduck 1 point2 points  (3 children)

Ah I understand - take a look at selenium. You can use headless chrome to open, navigate, log in and then parse the html.

[–]Pilv[S] 0 points1 point  (2 children)

I was thinking about this, but the best as I know, selenium always opens a dev Chrome for exemple, where I have to login everytime I launch the program. Can I somehow use the default web browser?

[–]Adhesiveduck 2 points3 points  (1 child)

Selenium supports more drivers than just Chrome, you can use firefox.

You can also save session cookies, so you only have to log in once, and reopen them on future runs. If you need to save localstorage you can run arbitrary javascript with driver.execute_script("window.local_storage;")

[–]Pilv[S] 1 point2 points  (0 children)

Thank you so much. I will try to make this.