0

I use this part of code on Windows 10 and it works fine and the driver gets the data. When running on Ubuntu 20.04 the driver works without errors but doesn't receive anything. Specifically, the driver.requests is empty. Google Chrome and libraries are installed, chromedriver exists. I would be grateful if you could help me find out what could be the reason. This part of the code has been edited for Ubuntu.

#!/usr/bin/python
# -*- coding: utf-8 -*-

from seleniumwire import webdriver
from selenium.webdriver.chrome.options import Options
import time

chrome_options = Options()
chrome_options.add_argument("--headless")
driver = webdriver.Chrome(executable_path="/usr/bin/chromedriver", options=chrome_options)
driver.get("myUrl")
time.sleep(3)
x = ""

for request in driver.requests:
    if "chip" in request.url:
        x = str(request)
        break

print(x)
  • Are you sure you made the chromedriver an executable? If not try this. `chmod +x chromedriver` – Denel May 25 '22 at 12:04
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community May 25 '22 at 12:09
  • @Denel Thank you for your response! Now I have done this, but nothing has changed. – Никита Пешков May 25 '22 at 12:12
  • Do you get any debug output when running the program? like `DevTools listening on...` or anything similar? Or no output at all? And did you download the correct version of the chromedriver? corresponding with the chrome installed on your ubuntu? (and it should be either 32/64 bit depending on your system) – Denel May 25 '22 at 12:51

0 Answers0