Skip to content

Commit

Permalink
fix mail
Browse files Browse the repository at this point in the history
  • Loading branch information
kangvcar committed Oct 20, 2020
1 parent 6108f72 commit b1699ec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Spiders/mail/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,13 @@ def gen_driver(self, cookies_list):
option.add_experimental_option("prefs", {"profile.managed_default_content_settings.images": 2}) # 不加载图片,加快访问速度
option.add_argument('--headless')
self.driver = webdriver.Chrome(options=option)
# self.driver.get('https://outlook.live.com/mail/0/inbox')
self.driver.get('https://outlook.live.com/mail/inbox')
for i in cookies_list:
self.driver.add_cookie(cookie_dict=i)
self.driver.get('https://outlook.live.com/mail/inbox')
# self.driver.get('https://outlook.live.com/mail/0/inbox')

except Exception as e:
print(e)

Expand All @@ -145,6 +148,7 @@ def get_hotmail(self, cookie_list):
time.sleep(2)
page_source = self.driver.page_source
obj_list = etree.HTML(page_source).xpath('//div[contains(@class,"customScrollBar")]')[1].xpath('./div/div')[1:]
# obj_list = etree.HTML(page_source).xpath('//div[contains(@role,"option")]')[:]
json_list = []
i = 0
for obj in obj_list[:100]:
Expand Down

0 comments on commit b1699ec

Please sign in to comment.