京东自动入会获取京豆

Overview

京东入会领京豆

要求

  1. 有一定的电脑知识 or 有耐心爱折腾
  2. 需要Chrome(推荐)Edge(Chromium)Firefox
  3. 操作系统需是Mac(本人没在m1上测试)Linux(在deepin上测试过)Windows

安装方法

脚本采用Selenium遍历京东入会有礼界面,由于遍历了20000+个店铺,可能所需要的时间比较长(视电脑情况30min-5h)

  1. 克隆到本地

    git clone https://github.com/AntonVanke/JDBrandMember.git
  2. 安装所需要的包

    pip3 install -r requirements.txt
  3. 下载对应的浏览器驱动放到项目的drivers文件夹下面

    1. chrome请访问chrome://version/查看浏览器的版本,然后去ChromeDriver Mirror (taobao.org)下载对应的版本/系统驱动
    2. edge请访问edge://version/查看浏览器的版本,Microsoft Edge - Webdriver (windows.net)下载
    3. Firefox请访问Releases · mozilla/geckodriver (github.com)下载
  4. 配置config.json

    {
        "thread": 6,  # 线程数, 推荐4-8线程
        "browserType": "Chrome",  # Chrome/Edge/Firefox
        "headless": true,  # 无头模式 请保持开启否则多线程情况下窗口比较多
        "binary": "",  # 可执行路径,如果驱动没有找到浏览器的话需要你手动配置
        "useUser": 0,  # 用户下标,默认是0(users[0]第一个用户)
        "users": []  # 用户列表可以通过 add_cookie.py 添加
    }
  5. 添加cookie

    请在项目目录下执行python3 add_cookie.py, 在打开的浏览器界面登录你的京东,此时你可以看到config.json已经有了你的用户信息(请不要随意泄露你的cookie

  6. 执行主程序

    在项目目录下执行python3 main.py,等待执行完毕即可,你可以访问项目下的logs/jdbm.log查看你的日志

LICENSE

MIT License

Copyright (c) 2021 Vanke Anton

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Comments
  • 报错:OSError: [WinError 193] %1 不是有效的 Win32 应用程序

    报错:OSError: [WinError 193] %1 不是有效的 Win32 应用程序

    2021-05-21 21:52:18 INFO 结束运行 Traceback (most recent call last): File "C:\Users\Yang\Desktop\JDBrandMember-main\main.py", line 391, in main() File "C:\Users\Yang\Desktop\JDBrandMember-main\main.py", line 341, in main add_cookie() File "C:\Users\Yang\Desktop\JDBrandMember-main\main.py", line 102, in add_cookie browser = get_browser(False) File "C:\Users\Yang\Desktop\JDBrandMember-main\main.py", line 89, in get_browser return webdriver.Chrome(executable_path=get_file_path("drivers/chromedriver"), desired_capabilities={}, File "C:\Users\Yang\AppData\Local\Programs\Python\Python39-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in init self.service.start() File "C:\Users\Yang\AppData\Local\Programs\Python\Python39-32\lib\site-packages\selenium\webdriver\common\service.py", line 72, in start self.process = subprocess.Popen(cmd, env=self.env, File "C:\Users\Yang\AppData\Local\Programs\Python\Python39-32\lib\subprocess.py", line 951, in init self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\Yang\AppData\Local\Programs\Python\Python39-32\lib\subprocess.py", line 1420, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, OSError: [WinError 193] %1 不是有效的 Win32 应用程序。

    opened by lanyucomputer 27
  • ubuntu 下无法运行

    ubuntu 下无法运行

    按照攻略执行到 python3 main.py后产生报错 Traceback (most recent call last): File "/root/jd/ht/main.py", line 1, in import ctypes File "/usr/local/python3/lib/python3.9/ctypes/init.py", line 8, in from _ctypes import Union, Structure, Array ModuleNotFoundError: No module named '_ctypes'

    已经按照百度安装了libffi-devel python3 版本--Python 3.9.4 请问大神有解决的方法吗

    opened by winsonhet 12
  • termux终端可否实现跑脚本?

    termux终端可否实现跑脚本?

    大神,你好

        想尝试在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

      因不便用电脑,想问下,有没有可能在终端里跑这个脚本,谢谢!
    
    opened by biewenwoshishui021 6
  • 为什么会报错,用提3.8和3.95版64位的,难道要用32位的PYTHON吗?我等下用32位试下,不行再来反馈

    为什么会报错,用提3.8和3.95版64位的,难道要用32位的PYTHON吗?我等下用32位试下,不行再来反馈

    2021-05-21 21:33:22 INFO 结束运行 Traceback (most recent call last): File "C:\Users\Yang\Desktop\JDBrandMember-main\main.py", line 391, in main() File "C:\Users\Yang\Desktop\JDBrandMember-main\main.py", line 341, in main add_cookie() File "C:\Users\Yang\Desktop\JDBrandMember-main\main.py", line 102, in add_cookie browser = get_browser(False) File "C:\Users\Yang\Desktop\JDBrandMember-main\main.py", line 89, in get_browser return webdriver.Chrome(executable_path=get_file_path("drivers/chromedriver"), desired_capabilities={}, File "C:\Users\Yang\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in init self.service.start() File "C:\Users\Yang\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\common\service.py", line 72, in start self.process = subprocess.Popen(cmd, env=self.env, File "C:\Users\Yang\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 951, in init self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\Yang\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1420, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, OSError: [WinError 193] %1 不是有效的 Win32 应用程序。

    opened by lanyucomputer 3
  • 大佬能不能看一下这是什么问题

    大佬能不能看一下这是什么问题

    File "E:\JD\main.py", line 89, in get_browser return webdriver.Chrome(executable_path=get_file_path("drivers/chromedriver"), desired_capabilities={}, File "D:\python\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 76, in init RemoteWebDriver.init( File "D:\python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in init self.start_session(capabilities, browser_profile) File "D:\python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "D:\python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute self.error_handler.check_response(response) File "D:\python\lib\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: cannot find Chrome binary

    opened by RPZ1211 3
  • 运行出错

    运行出错

    运行出现以下错误,求教大佬如何解决,使用的平台是win10,Google Chrome 版本 90.0.4430.72(正式版本) (64 位),用的最新版京东入会有礼刷京豆0.3(附打包程序) DevTools listening on ws://127.0.0.1:9254/devtools/browser/88214b30-de5f-4a44-be75-3ad51055359f [14228:9528:0420/041210.575:ERROR:ssl_client_socket_impl.cc(947)] handshake failed; returned -1, SSL error code 1, net_error -101 [14228:9528:0420/041210.684:ERROR:ssl_client_socket_impl.cc(947)] handshake failed; returned -1, SSL error code 1, net_error -101 2021-04-20 04:12:15 INFO 登录成功 用户名:京豆数: [14772:7852:0420/041216.733:ERROR:device_event_log_impl.cc(214)] [04:12:16.734] Bluetooth: bluetooth_adapter_winrt.cc:1072 Getting Default Adapter failed. [15200:14480:0420/041404.804:ERROR:gpu_init.cc(426)] Passthrough is not supported, GL is disabled

    opened by bbilyvm 3
Releases(v21.05.31)
  • v21.05.31(May 31, 2021)

  • v21.05.30(May 30, 2021)

  • v21.05.15(May 14, 2021)

  • v21.04.30(Apr 30, 2021)

    https://github.com/AntonVanke/JDBrandMember/issues/19#issuecomment-829754120 https://github.com/AntonVanke/JDBrandMember/issues/19#issuecomment-830176294 https://github.com/AntonVanke/JDBrandMember/issues/21#issuecomment-829757868 https://github.com/AntonVanke/JDBrandMember/issues/15


    1. 修改了进度条显示
    2. 更新了 shopid.txt
    3. 修复了去重的方式
    4. 重新遍历了近期(2021年04月30日)入会送京豆的网站

    注意:

    1. config.json包含你的用户信息
    2. 如果关闭程序后CPU占用率依旧很高,请执行stop.bat如果你正在使用浏览器,执行前请保存好你的浏览器内容。
    3. 这是一个测试版本
    4. 其它请查看readme.md

    https://github.com/AntonVanke/JDBrandMember/blob/main/README.md#%E5%AE%89%E8%A3%85%E6%96%B9%E6%B3%95

    这个项目是我为了练习数据爬取而创建的,可能会有各式各样的错误,如果有什么问题的话欢迎反馈。
    Source code(tar.gz)
    Source code(zip)
    21_04_30_Windows_10_Chrome.zip(16.34 MB)
  • v21.04.24-beta(Apr 24, 2021)

    更新了以下内容

    1. 加快了遍历速度,降低cpu占用率
    2. 独立了添加cookie的程序add_cookie.exe,可以添加多用户(暂时需在config手动选择)
    3. 重新遍历了近期(2021年04月23日)入会送京豆的网站

    使用了Pyinstaller打包了Windows平台的应用程序,解压缩首先运行add_cookie.exe添加用户,再运行main.exe开始。

    默认的Chrome驱动版本是90.0.4430.85,其它版本的Chrome请自行下载;其它版本的浏览器请自行下载驱动并配置config.json

    注意:

    1. config.json包含你的用户信息
    2. 如果关闭程序后CPU占用率依旧很高,请执行stop.bat如果你正在使用浏览器,执行前请保存好你的浏览器内容。
    3. 这是一个测试版本
    4. 其它请查看readme.md
    这个项目是我为了练习数据爬取而创建的,可能会有各式各样的错误,如果有什么问题的话欢迎反馈。
    Source code(tar.gz)
    Source code(zip)
    21_04_24_Windows_10_Chrome.zip(22.01 MB)
  • v21.04.17(Apr 17, 2021)

    更新了以下内容

    • 采用多线程的方式,更快速的遍历(能在一个小时遍历完全)
    • 重新爬取了京东的店铺数据,将50万个店铺精简到25878
    • 重新遍历了近期(2021年04月17日)入会送京豆的网站,存储在url.txt下,以供快速刷分

    另外使用了Pyinstaller打包了三个平台的应用程序,解压缩运行即可

    注意:

    Linux 可能会遇到找不到chrome的情况,需要配置目录

    请在电脑上安装对应版本的Chrome浏览器

    pyinstaller打包的应用程序可能会有各式各样的问题,建议还是直接运行Python代码

    这个项目是我为了练习数据爬取而创建的,可能会有各式各样的错误,因为我是初学者,如果有什么问题的话可以联系我。
    Source code(tar.gz)
    Source code(zip)
    21_04_17_Linux_Chrome.zip(12.25 MB)
    21_04_17_Mac_86_64_Chrome.zip(15.87 MB)
    21_04_17_Windows_10_Chrome.zip(13.15 MB)
  • v21.04.04(Apr 4, 2021)

  • v21.04.02(Apr 2, 2021)

    Source code(tar.gz)
    Source code(zip)
Owner
Vanke Anton
Vanke Anton
A domonic-like wrapper around selectolax

A domonic-like wrapper around selectolax

byteface 3 Jun 23, 2022
WordPress-style shortcodes for Python

Python Shortcodes WordPress-style shortcodes for Python Create and use WordPress-style shortcodes in your Python based app. Example # static output de

Bob 1 Dec 22, 2021
A python script for combining multiple native SU2 format meshes into one mesh file for multi-zone simulations.

A python script for combining multiple native SU2 format meshes into one mesh file for multi-zone simulations.

MKursatUzuner 1 Jan 20, 2022
The Begin button and menu for the Meadows operating system. The start button for UNIX/Linux.

By: Seanpm2001, Meadows Et; Al. Top README.md Read this article in a different language Sorted by: A-Z Sorting options unavailable ( af Afrikaans Afri

Sean P. Myrick V19.1.7.2 4 Aug 28, 2022
Python script which synchronizes the replica-directoty with the original-one.

directories_synchronizer Python script which synchronizes the replica-directoty with the original-one. Automatically detects all changes when script i

0 Feb 13, 2022
Imports an object based on a string import_string('package.module:function_name')() - Based on werkzeug.utils

DEPRECATED don't use it. Please do: import importlib foopath = 'src.apis.foo.Foo' module_name = '.'.join(foopath.split('.')[:-1]) # to get src.apis.f

Bruno Rocha Archived Projects 11 Nov 12, 2022
Run-Your-Own Firefox Sync Server

Run-Your-Own Firefox Sync Server This is an all-in-one package for running a self-hosted Firefox Sync server. It bundles the "tokenserver" project for

Mozilla Services 1.7k Dec 30, 2022
DC619/DC858 Mainframe Environment/Lab

DC619 Training LPAR The file DC619 - Mainframe Overflows Hands On.pdf contains the labs and walks through how to perform them. Use docker You can use

Soldier of FORTRAN 9 Jun 27, 2022
SimilarWeb for Team ACT v.0.0.1

SimilarWeb for Team ACT v.0.0.1 This module has been built to provide a better environment specifically for Similarweb in Team ACT. This module itself

Sunkyeong Lee 0 Dec 29, 2021
Python 100daysofcode

#python #100daysofcode Python is a simple, general purpose ,high level & object-oriented programming language even it's is interpreted scripting langu

Tara 1 Feb 10, 2022
A cheat sheet for streamlit

Streamlit Cheat Sheet App to summarise streamlit docs v1.0.0 There is also an accompanying png and pdf version https://github.com/daniellewisDL/stream

Daniel Lewis 221 Jan 04, 2023
List of resources for learning Category Theory

A curated list of resources for studying category theory. As resources aimed at mathematicians are abundant, this list is aimed at materials whose target audience is not people with a graduate-level

Bruno Gavranović 100 Jan 01, 2023
A web UI for managing your 351ELEC device ROMs.

351ELEC WebUI A web UI for managing your 351ELEC device ROMs. Requirements Python 3 or Python 2.7 are required. If the ftfy package is installed, it w

Ben Phelps 5 Sep 26, 2022
Modelling the 30 salamander problem from `Pure Mathematics` by Martin Liebeck

Salamanders on an island The Problem From A Concise Introduction to Pure Mathematics By Martin Liebeck Critic Ivor Smallbrain is watching the horror m

Faisal Jina 1 Jul 10, 2022
TikTok Auto Claimer Made By Aim low!#9999 Leaked By bazooka#0001

Zues Auto Claimer Leaked By bazooka#0001 put proxies in prox.txt put ssid in sid.txt put all users you want to target in user.txt for the login just t

1 Jan 14, 2022
MIT version of the PyMca XRF Toolkit

PyMca This is the MIT version of the PyMca XRF Toolkit. Please read the LICENSE file for details. Installation Ready-to-use packages are available for

V. Armando Solé 43 Nov 23, 2022
Automatically re-open threads when they get archived, no matter your boost level!

ThreadPersist Automatically re-open threads when they get archived, no matter your boost level! Installation You will need to install poetry to run th

7 Sep 18, 2022
A web application (with multiple API project options) that uses MariaDB HTAP!

Bookings Bookings is a web application that, backed by the power of the MariaDB Connectors and the MariaDB X4 Platform, unleashes the power of smart t

MariaDB Corporation 4 Dec 28, 2022
A Brainfuck interpreter written in Python.

A Brainfuck interpreter written in Python.

Ethan Evans 1 Dec 05, 2021
python scripts to perform coin die clustering (performed on Riedones3D).

python scripts to perform coin die clustering (performed on Riedones3D).

Sofiane 2 Apr 29, 2022