Giter VIP home page Giter VIP logo

Comments (6)

AntonVanke avatar AntonVanke commented on July 21, 2024

由于Chrome的驱动只支持linux、mac、Windows,所以你在手机上是运行不了的。我这个星期天去看看怎么移植到nodejs上,这样在手机上也能跑了,可能遍历会很慢。

from jdbrandmember.

biewenwoshishui021 avatar biewenwoshishui021 commented on July 21, 2024

好的,谢谢大神!

from jdbrandmember.

biewenwoshishui021 avatar biewenwoshishui021 commented on July 21, 2024

请问大神,nodejs有没有可能实现?我跑了一下最新版,还是chromedriver的问题。

python3 main.py

2021-04-24 12:42:01 ERROR 浏览器错误 请检查你的驱动和配置

Exception in thread Thread-2:
Traceback (most recent call last):
File "/data/data/com.termux/files/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner

2021-04-24 12:42:01 ERROR 浏览器错误 请检查你的驱动和配置

2021-04-24 12:42:01 ERROR 浏览器错误 请检查你的驱动和配置

2021-04-24 12:42:01 ERROR 浏览器错误 请检查你的驱动和配置
self.run()
File "/data/data/com.termux/files/usr/lib/python3.9/threading.py", line 892, in run
Exception in thread Thread-4:
Traceback (most recent call last):
File "/data/data/com.termux/files/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
Exception in thread Thread-1:

Traceback (most recent call last):

2021-04-24 12:42:01 ERROR 浏览器错误 请检查你的驱动和配置
File "/data/data/com.termux/files/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner

self.run()

File "/data/data/com.termux/files/usr/lib/python3.9/threading.py", line 892, in run
Exception in thread Thread-3:
Traceback (most recent call last):
self._target(*self._args, **self._kwargs)
Exception in thread Thread-5:
Traceback (most recent call last):
self._target(*self._args, **self._kwargs)
self.run()
File "/data/data/com.termux/files/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
File "/data/data/com.termux/files/home/JDBrandMember/main.py", line 192, in traversals
File "/data/data/com.termux/files/usr/lib/python3.9/threading.py", line 892, in run
File "/data/data/com.termux/files/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
File "/data/data/com.termux/files/home/JDBrandMember/main.py", line 192, in traversals
self.run()

2021-04-24 12:42:01 ERROR 浏览器错误 请检查你的驱动和配置

self._target(*self._args, **self._kwargs)

File "/data/data/com.termux/files/usr/lib/python3.9/threading.py", line 892, in run
browser.get("https://www.jd.com/")
self.run()
Exception in thread Thread-6:
AttributeError: 'NoneType' object has no attribute 'get'
File "/data/data/com.termux/files/usr/lib/python3.9/threading.py", line 892, in run
Traceback (most recent call last):
File "/data/data/com.termux/files/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
File "/data/data/com.termux/files/home/JDBrandMember/main.py", line 192, in traversals
browser.get("https://www.jd.com/")
self._target(self._args, **self._kwargs)
self.run()
AttributeError: 'NoneType' object has no attribute 'get'
File "/data/data/com.termux/files/home/JDBrandMember/main.py", line 192, in traversals
File "/data/data/com.termux/files/usr/lib/python3.9/threading.py", line 892, in run
self._target(self._args, **self._kwargs)
File "/data/data/com.termux/files/home/JDBrandMember/main.py", line 192, in traversals
browser.get("https://www.jd.com/")
self._target(self._args, **self._kwargs)
AttributeError: 'NoneType' object has no attribute 'get'
browser.get("https://www.jd.com/")
browser.get("https://www.jd.com/")
File "/data/data/com.termux/files/home/JDBrandMember/main.py", line 192, in traversals
AttributeError: 'NoneType' object has no attribute 'get'
AttributeError: 'NoneType' object has no attribute 'get'
browser.get("https://www.jd.com/")
AttributeError: 'NoneType' object has no attribute 'get'
正在执行:0.00000%[->
*******************************************************************]此次运行获得0京豆运行结束

from jdbrandmember.

AntonVanke avatar AntonVanke commented on July 21, 2024

我尝试着在手机上使用nodejs puppeteer好像还是不兼容等下星期我考完试了我会再研究研究的

from jdbrandmember.

biewenwoshishui021 avatar biewenwoshishui021 commented on July 21, 2024

谢谢!

from jdbrandmember.

AntonVanke avatar AntonVanke commented on July 21, 2024

大神,你好

    想尝试在termux上跑这个脚本,但失败了,可能是没有安装或者说没有正确识别google driver有关。错误如下:

运行python3 main.py

Traceback (most recent call last):
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line 72, in start
self.process = subprocess.Popen(cmd, env=self.env,
File "/data/data/com.termux/files/usr/lib/python3.9/subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/data/data/com.termux/files/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'drivers/chromedriver'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/data/data/com.termux/files/home/JDBrandMember/main.py", line 254, in
browser = getBrowser(headless=False)
File "/data/data/com.termux/files/home/JDBrandMember/main.py", line 224, in getBrowser
_browser = webdriver.Chrome(executable_path="drivers/chromedriver", options=chrome_options)
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in init
self.service.start()
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line 81, in start
raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

  因不便用电脑,想问下,有没有可能在终端里跑这个脚本,谢谢!

抱歉,我即便使用puppeteer 也无法在termux上运行,可能是我技术不过关😭,所以我没法弄了。如果你不便使用电脑跑脚本的话,我可以给你跑

from jdbrandmember.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.