Browse Source

Merge pull request #8 from YuTao0310/test

fix(core.spider): remove useless functions and fix function args self.count to self.skuids
master
Louis 3 years ago committed by GitHub
parent
commit
d34427a07f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      Core/login.py
  2. 11
      Core/spider.py

10
Core/login.py

@ -136,15 +136,6 @@ class QrLogin: @@ -136,15 +136,6 @@ class QrLogin:
logger.error("验证cookies是否有效发生异常", e)
return False
def _get_login_page(self):
"""
获取PC端登录页面
:return:
"""
url = "https://passport.jd.com/new/login.aspx"
page = self.session.get(url, headers=self.spider_session.get_headers())
return page
def _get_qrcode(self):
"""
缓存并展示登录二维码
@ -229,7 +220,6 @@ class QrLogin: @@ -229,7 +220,6 @@ class QrLogin:
二维码登陆
:return:
"""
self._get_login_page()
# download QR code
if not self._get_qrcode():

11
Core/spider.py

@ -197,15 +197,6 @@ class Waiter(): @@ -197,15 +197,6 @@ class Waiter():
print('库存状态:{}(无现货)'.format(jsparser['StockStateName']))
return False
def _get_item_detail_page(self, sku_id):
"""访问商品详情页
:param sku_id: 商品id
:return: 响应
"""
url = 'https://item.jd.com/{}.html'.format(sku_id)
page = requests.get(url=url, headers=self.headers)
return page
def _waitForSell(self):
area_id = self.area
sku_id = self.skuids
@ -709,7 +700,7 @@ class Waiter(): @@ -709,7 +700,7 @@ class Waiter():
self.change_item_num_in_cart(
sku_id=sku_id,
vender_id=cart_item.get('vender_id'),
num=self.skuids,
num=self.count,
p_type=cart_item.get('p_type'),
target_id=cart_item.get('target_id'),
promo_id=cart_item.get('promo_id')

Loading…
Cancel
Save