T
T
turik_0072018-07-28 13:33:35
Python
turik_007, 2018-07-28 13:33:35

Python working with chrome browser how to get page code?

The essence of the question is this: how to launch the installed chrome browser from python or another language (c, c++, c#), go to the page, make a request and get the page code?
There is a selenium library, but it runs chromedriver.exe, which is not it: it does not have my data stored in the installed chrome. There is also a webbrowser library built into python, it runs what it needs, but there is no way to get the page code.
Maybe there is a chrome launch option that saves the page code?
There is, however, an option to feed selenium cookies, but for some reason this thing does not want to work, besides, you cannot feed some cookies there and you need to feed them every launch. + doing this from Windows
In general, launching the installed chrome browser and getting the page code is ideal.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dimonchik, 2018-07-28
@turik_007

something a lot of categoricalness
, especially webbrowser amused
as for selenium, then

ChromeOptions options = new ChromeOptions();
options.addArguments("user-data-dir=/path/to/your/custom/profile");

Python code may be slightly different.

A
AVKor, 2018-07-28
@AVKor

There is a selenium library, but it runs chromedriver.exe, which is not it: it does not have my data stored in the installed chrome.

Nothing is stored in the program.
With the help of selenium + chromedriver this can be done.
google://seleniumchrome profile

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question