Coder Social home page Coder Social logo

Comments (12)

AntonVanke avatar AntonVanke commented on August 20, 2024

你用的python是否为ubuntu 自带的?
我在deepin下测试并没有这个报错。


不过ctypes是无关紧要的,我已经将一些函数去掉了,应该可以运行。修改后的文件已附上,替换原有的main.py即可
main.py

from jdbrandmember.

winsonhet avatar winsonhet commented on August 20, 2024

谢谢您的帮忙,已经更换了main.py,产生了新的报错,这个python3是系统自带的,升级到了3.9.4

日志已生成,查看./logs/ Some log data is being generated: ./log/ ...正在关闭,不要退出
Traceback (most recent call last):
File "/root/jd/ht/main.py", line 72, in get_browser
return webdriver.Chrome(executable_path=get_file_path("drivers/chromedriver"), desired_capabilities={},
File "/usr/local/python3/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py", line 76, in init
RemoteWebDriver.init(
File "/usr/local/python3/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in init
self.start_session(capabilities, browser_profile)
File "/usr/local/python3/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/usr/local/python3/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/usr/local/python3/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/root/jd/ht/main.py", line 374, in
main()
File "/root/jd/ht/main.py", line 324, in main
add_cookie()
File "/root/jd/ht/main.py", line 85, in add_cookie
browser = get_browser(False)
File "/root/jd/ht/main.py", line 77, in get_browser
raise WebDriverException
selenium.common.exceptions.WebDriverException: Message: None

from jdbrandmember.

winsonhet avatar winsonhet commented on August 20, 2024

之前的版本是可以运行的,这是运行在vps上,没有图形界面,只有文字终端,我想是不是这个原因,无法在第一步跳出浏览器?

from jdbrandmember.

AntonVanke avatar AntonVanke commented on August 20, 2024

之前的版本是可以运行的,这是运行在vps上,没有图形界面,只有文字终端,我想是不是这个原因,无法在第一步跳出浏览器?

我刚刚也在想你是否用的是无图形界面的


如果你用的是无图形界面的,你需要先在本地配置完config.json上传上去,防止远程启动浏览器登录

from jdbrandmember.

AntonVanke avatar AntonVanke commented on August 20, 2024

如果你的服务器核心/带宽比较少的话,thread建议设置为4以下

from jdbrandmember.

winsonhet avatar winsonhet commented on August 20, 2024

还是不行,已经把config放进去

[root@jindou-xianggang ht]# python3 main.py
验证账号1中,中途退出可能会误认为账号失效而删除
日志已生成,查看./logs/ Some log data is being generated: ./log/ ...正在关闭,不要退出
Traceback (most recent call last):
File "/root/jd/ht/main.py", line 374, in
main()
File "/root/jd/ht/main.py", line 326, in main
check_user()
File "/root/jd/ht/main.py", line 300, in check_user
_browser.add_cookie(cookie)
File "/usr/local/python3/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 894, in add_cookie
self.execute(Command.ADD_COOKIE, {'cookie': cookie_dict})
File "/usr/local/python3/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/usr/local/python3/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidCookieDomainException: Message: invalid cookie domain: Cookie 'domain' mismatch
(Session info: headless chrome=90.0.4430.93)

[root@jindou-xianggang ht]#

from jdbrandmember.

AntonVanke avatar AntonVanke commented on August 20, 2024

你的服务器是否不在**大陆?


在境外登录京东会自动跳转到对应的境外京东页面

使用这个Main.py可能会解决问题

from jdbrandmember.

winsonhet avatar winsonhet commented on August 20, 2024

谢谢AotonVanke大神的帮助,虽然服务网在香港,确实是这个问题
咱们可以实现静默运行吗,每次运行的时候即使把config文件导入进入后运行,还是依然需要选择,终端需要一直连接上去
以前的版本我都是用nohup命令丢在后台自己跑

from jdbrandmember.

AntonVanke avatar AntonVanke commented on August 20, 2024

谢谢AotonVanke大神的帮助,虽然服务网在香港,确实是这个问题
咱们可以实现静默运行吗,每次运行的时候即使把config文件导入进入后运行,还是依然需要选择,终端需要一直连接上去
以前的版本我都是用nohup命令丢在后台自己跑

我已经在尝试将selenium转向更简单的requests了,虽然直接的访问可能会被黑号
后续会有直接运行的,且不需要浏览器驱动了

from jdbrandmember.

HANSCOM123 avatar HANSCOM123 commented on August 20, 2024

完整版shopid可以提供一份吗~AotonVanke大神

from jdbrandmember.

winsonhet avatar winsonhet commented on August 20, 2024

期待您的更新

from jdbrandmember.

AntonVanke avatar AntonVanke commented on August 20, 2024

完整版shopid可以提供一份吗~AotonVanke大神

是50万的那个吗,你可以看看提交记录#4de8dbc7e0bc748feddcb07574e77daaeca91454前几版的就是的,后来我重新遍历了一遍才这么少了,主要是好多店铺没有店铺会员

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.