Skip to content
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

能不能帮忙添加进店领金豆任务 #60

Open
flyingsnow0102 opened this issue Jul 10, 2018 · 0 comments
Open

能不能帮忙添加进店领金豆任务 #60

flyingsnow0102 opened this issue Jul 10, 2018 · 0 comments

Comments

@flyingsnow0102
Copy link

能不能帮忙添加进店领金豆任务
任务地址:
http://bean.jd.com/myJingBean/list#earnBean

1、获取可领金豆店铺地址:
def get_shops():
headers['Referer'] = 'https://home.jd.com/'
response = s.get(bean_url, headers=headers)
soup = BeautifulSoup(response.text, 'lxml')
bean_shop_list = soup.find_all('a', class_='s-btn')
return bean_shop_list

2、进店领金豆
def sign_shop(shop_url):
try:
headers['Referer'] = str(shop_url)
response = s.get(shop_url, headers=headers)
soup = BeautifulSoup(response.text, 'lxml')
# 获取店铺 id
shop_id = soup.find(id='shop_id')['value']
# 拼接签到地址
sign_url = 'https://mall.jd.com/shopSign-{}.html'.format(shop_id)
s.get(sign_url, headers=headers)
print('签到成功:{}'.format(shop_url))
except Exception as error:
print('签到失败:{}'.format(shop_url))
print(error)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant