0

this my code:

import requests
from bs4 import BeautifulSoup

Url = "https://gmail.com"
R = requests.get(Url)
Soup = BeautifulSoup(R.text,"lxml")
print(Soup)

But i need my cookies, login datas and other things and they are stored in google chrome so i want getting url via google chrome.

Path of Google Chrome: "C:\Program Files\Google\Chrome\Application\chrome.exe"

is that possible? Thanks...

  • If you want to open a url using a browser... use a brower. If you want to open a browser with a given url, call it like "path_to_chrome_exe url"... But If you want to use requests with chrome cookies, take a look [here](https://stackoverflow.com/questions/55729726/python-how-to-use-chrome-cookies-in-requests) – scmanjarrez Jul 01 '21 at 12:02
  • @Sr.S Hmm So how i can do it on this code? actually i have other ideas. – PythonCodexR Jul 01 '21 at 12:06
  • Please, take a look at the url I posted. There are some examples. – scmanjarrez Jul 01 '21 at 12:10
  • @Sr.S Thanks but they are not for this project – PythonCodexR Jul 01 '21 at 12:22

1 Answers1

0

the problem is that you must use selenium, download the chrome webdriver `options = webdriver.ChromeOptions() options.add_argument('--start-maximized') options.add_argument('--disable-extensions')

driver_path= 'C:\Users\your_user_here\Downloads\chromedriver.exe'

driver = webdriver.Chrome(driver_path, chrome_options=options)`

ZeusPod
  • 28
  • 3