Run Selenium Python script on Android with Pydroid Selendroid

3.1k Views Asked by At

I have to run this Selenium Python script on Android.

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By

from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("--headless")
chrome_options.add_argument('--log-level=1')

s=Service("C:/Users/Python/chromedriver")
driver = webdriver.Chrome(service=s, options=chrome_options)
driver.get('https://www.amazon.it/dp/B08T769JQD')


title = driver.find_element(By.ID, "productTitle").text
print(title)

I tried Pydroid, but when i use "pip install selenium", i have this error.

enter image description here

I have the last pip version installed.

I tried to install Rust with "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh", but i have this error.

enter image description here

I saw that exists Selendroid, but how can i implement it with my script and Pydroid?

1

There are 1 best solutions below

1
Ash rd On BEST ANSWER

/storage/emulated/0 pip install --no-deps selenium

this will ignore other installation

working in Pydroid