京东自动入会获取京豆

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
This program generates automatically new folders containing old version of program

Automated Folder Versions Generator by Sergiy Grimoldi - V.0.0.2 This program generates automatically new folders containing old version of something

Sergiy Grimoldi 1 Dec 23, 2021
Compile Binary Ninja's HLIL IR to LLVM, for purposes of compiling it back to a binary again.

Compiles BinaryNinja's HLIL to LLVM Approach Sweep binary for global variables, create them Sweep binary for (used?) external functions, declare those

Kyle Martin 31 Nov 10, 2022
Web App for University Project

University Project About I made this web app to finish a project assigned by my teacher. It is written entirely in Python, thanks to streamlit to make

15 Nov 27, 2022
Personal Finance Forecaster - An AI tool for forecasting personal expenses

Personal Finance Forecaster - An AI tool for forecasting personal expenses

2 Mar 09, 2022
APRS Track Direct is a collection of tools that can be used to run an APRS website

APRS Track Direct APRS Track Direct is a collection of tools that can be used to run an APRS website. You can use data from APRS-IS, CWOP-IS, OGN, HUB

Per Qvarforth 42 Dec 29, 2022
Painel simples com consulta de cep,CNPJ,placa e ip

Painel mpm Um painel simples com consultas de IP, CNPJ, CEP, PLACA, TELEFONE, CPF e NOME Início 🌐 apt update && apt upgrade -y pkg i python git pip i

8 Feb 27, 2022
An audnexus client, providing rich author and audiobook data to Plex via it's legacy plugin agent system.

Audnexus.bundle An audnex.us client, providing rich author and audiobook data to Plex via it's legacy plugin agent system. 📝 Table of Contents About

David Dembeck 248 Jan 02, 2023
Find virtual hosts (vhosts) from IP addresses and hostnames

Features Enumerate vhosts from a list of IP addresses and domain names. Virtual Hosts are enumerated using the following process: Supplied domains are

3 Jul 09, 2022
Rotating cube with hand

I am still working on this project :)) To-Do(Present): = It needs an algorithm to fine tune my hand's coordinates for rotation of our cube (initial o

Jay Desale 2 Dec 26, 2021
A python library for writing parser-based interactive fiction.

About IntFicPy A python library for writing parser-based interactive fiction. Currently in early development. IntFicPy Docs Parser-based interactive f

Rita Lester 31 Nov 23, 2022
Data Structures and Algorithms Python - Practice data structures and algorithms in python with few small projects

Data Structures and Algorithms All the essential resources and template code nee

Hesham 13 Dec 01, 2022
Is a polybar module that will show you your progress in Hack The Box

HTB-Status for Polybar Is a polybar module that will show you your progress in Hack The Box indicating your current rank, global rank, points and resp

bitc0de 8 Jan 14, 2022
Magenta: Music and Art Generation with Machine Intelligence

Magenta is a research project exploring the role of machine learning in the process of creating art and music. Primarily this involves developing new

Magenta 18.1k Jan 05, 2023
End-to-End text sumarization, QAs generation using flask.

Help-Me-Read A web application created with Flask + BootStrap + HuggingFace 🤗 to generate summary and question-answer from given input text. It uses

Ankush Kuwar 12 Nov 13, 2022
easy_sbatch - Batch submitting Slurm jobs with script templates

easy_sbatch - Batch submitting Slurm jobs with script templates

Wei Shen 13 Oct 11, 2022
4Geeks Academy Full-Stack Developer program final project.

Final Project Chavi, Clara y Pablo 4Geeks Academy Full-Stack Developer program final project. Authors Javier Manteca - Coding - chavisam Clara Rojano

1 Feb 05, 2022
A simple python script that print the Mandelbrot set for every power of the formal formula.

Python Mandelbrot A simple python script that print the Mandelbrot set for every power of the formal formula.

Paride Giunta 2 Apr 15, 2022
Little tool in python to watch anime from the terminal (the better way to watch anime)

anipy-cli Little tool in python to watch anime from the terminal (the better way to watch anime) Has a resume playback function when picking from Hist

sdao 97 Dec 29, 2022
Learn to code in any language. If

Learn to Code It is an intiiative undertaken by Student Ambassadors Club, Jamshoro for students who are absolute begineers in programming and want to

Student Ambassadors' Club at Mehran UET 15 Oct 19, 2022
Pre-1.0 door/chest sound injector for Minecraft

doorjector Pre-1.0 door/chest sound injector for Minecraft. While the game is running, doorjector hotswaps the new sounds for the old right before the

Sam 1 Nov 20, 2021