【问题标题】:Run Selenium Python script on Android with Pydroid Selendroid使用 Pydroid Selendroid 在 Android 上运行 Selenium Python 脚本
【发布时间】:2021-11-10 11:20:37
【问题描述】:

我必须在 Android 上运行这个 Selenium Python 脚本。

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)

我尝试了 Pydroid,但是当我使用“pip install selenium”时,我遇到了这个错误。

我安装了最后一个 pip 版本。

我尝试使用“curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh”安装 Rust,但出现此错误。

我看到存在 Selendroid,但我如何用我的脚本和 Pydroid 实现它?

【问题讨论】:

    标签: python android selenium selendroid pydroid


    【解决方案1】:

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

    这将忽略其他安装

    在 Pydroid 中工作

    【讨论】:

    • 您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center
    猜你喜欢
    • 1970-01-01
    • 2021-12-19
    • 1970-01-01
    • 2018-06-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-09
    • 1970-01-01
    相关资源
    最近更新 更多