-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
termux selenium-webdriver #2149
Comments
Is there any way to run webdriver in termux when automating browsers using python in termux? |
I am also curious about this |
Selenium is written in java so it's portable, I think it would work |
would be great if termux can run a headless browser like phantomjs to be used in python |
Why not hook it to a native browser app? I think that would require adb enabled and phantomjs has been discontinued |
Or one can create a headless chrome package compiled to arm |
so it is possible to use selenium on termux ? if no witch alternatif can help to automatise browser in termux |
So anyone got anything? |
package request tag is added |
Does someone have submitted a pull request with build script and patches for Chromium or Firefox ? Seems no. Adding Selenium webdriver will be useless in such case. Tag "help wanted" should clearly describe the status of that issue... |
is always error 13 . isue is about permision to execute driver chrome or gecko |
just install ubuntu or any other distro on termux and therein install firefox or chromium and selenium For chromium
eg. For selenium 3 or less: For latest selenium 4, executable path option is deprecated so use object method as below: |
@tathastu871 yea, that's work, but we want same in termux itself |
For using it in termux itself following succesfully tested solution. capabilities = { |
Using a distro on termux will allow for portability for selenium automation however for using it on termux only we need to use adb. |
Final solution is to use remote capabilities where phone to be connected over wan using port forwarding and on pc which is kept running all day long with browser installed and whenever we are away from house or pc and want to use selenium on termux use remote capabilities using port and ip address of device. Port forwarding required only in case of wan when our pc and phone are on different network. While on lan and on same wifi no port forwarding require. |
adb, chromedriver or geckodriver, selenium are only needed for automating web on android browsers. Among them adb and selenium are both available as termux binaries without need of computer. Just as adb and fastboot binaries have been remade for termux if chromedriver is also rewritten and made to work in termux everything will be good. Then there will be no need to use computer or prooted linux distros, just a termux is sufficient |
This is the termux-packages repository. It's a little helpful to remember this works via proot or tethering, but the issue is around introducing termux packages to provide for systems that aren't tethered and don't have the space for a prooted distro. |
I also would like to be able to use Selenium with Termux or a similar solution |
@tathastu871 tried doing what you suggested but I always have a chrome driver not in path error, how do I fix this? Thanks |
driver = webdriver.Chrome('/path/to/chromedriver') |
Need help |
Use andronix app to install ubuntu or any other distro and install chromium or firefox with selenium using apt. However latest version of firefox may have some problems with selenium. if encountered try downgrading firefox and firefox-geckodriver packages to 75.0+build3-0ubuntu1 incase of chromium extra steps of specifying binary location is required |
I have written a package like selenium but only need termux to use, no pc require, you can do many simple tasks like login, submit form, .... |
Also theres a package called selendroid. Wonder anyone figured how to use it its a jar binary to control android apps |
Selendroid. No updates. 4 years. |
So what is the choice for old Android devices and no pc? |
I can't get this to work.. Any tips? I keep getting chrome driver not in path error.... |
Now Geckodriver is available for termux. Try enabling: Can anyone try it i cant enable adb on my device |
solution for android 11 above only |
no works for all. Once enable adb tcpip 5555 from pc. and Now on termux My usb us brokenso icant adb but here is selenium output
Means it was working and scanning for localhostjust that my adb is not enabled it says no device |
We have Firefox, chromium + chrome-driver in TUR. Firefox with geckodriver from the official repo works in termux. |
@xtkoba completed |
Can i get littel guide for how to use TUR with selenium |
apt install tur-repo
apt install firefox
# you can also use chromium instead
# firefox is light weight This will install tur-repo and firefox. Download gecko driver tar -xf geckodriver-v0.32.2-linux-aarch64.tar.gz
mv geckodriver $PREFIX/bin You may now use selenium as usual. Here is a python code from selenium import webdriver
driver = webdriver.Firefox()
# This will require a vnc connection
# you may run this in headless mode
# you will have to pass some arguments to the driver
driver.get("https://google.com") Edit: apt install geckodriver |
@SunPodder do I need proot-distro ? |
No |
Hi @SunPodder please both the firefox and the chromium cannot be found even after "apt update and apt upgrade" |
Pay attention to the order of |
Oh! Thanks i didn't add x11-repo earlier, after that i could see both chromium and firefox, please just wondering if you have a repo where you have succesfull scrapped a website with selelium using Node.js in termux, I will so much appreciate it thanks. And this wouldn't require PRoot i suppose. |
always use headless mode to prevnt excess memory use and crash |
Any code that works on linux should work on termux. Just make sure that code uses headless mode if you don't have a xserver. |
Thank you very much, 😊 |
Even if one doesn't want to use headless mode, then install xorg-server-xvfb and use the fake display, will work without headless. |
for who dont know how to install, i made this tutorial https://github.com/luanon404/Selenium-On-Termux-Android |
Selenium-Manager is not compiled for arm64 so you are unable to select chromedriver. |
how can i use termux tool that use selenium and python and require web browser to make it work on my android firefox app without the need to vnc what codes i need to edit in the tool |
I'm getting... update: 2nd update: |
Hi @luanon404 I am able to open the chromium from termux (Andrpoid 10). I am facing mainly four issues.
error : No browser open in my android device (In case of chromium it opens the chromium installed in my device) , but its seems like it is able to open browser some here in background, since I am able to see selenium webelement error which comes when you click a element which is obscured by some other element. Below are some details of my environment
Request you you if you can help me out here. |
|
Hey thanks for your reply.
Still can't see the firefox |
|
No description provided.
The text was updated successfully, but these errors were encountered: