Advertisement
Guest User

Untitled

a guest
Dec 8th, 2020
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. import scrapy
  2. from scrapy_requests import HtmlRequest
  3.  
  4. cookies = {my_cookies}
  5.  
  6. class RusSpider(scrapy.Spider):
  7.     name = 'rus'
  8.  
  9.     def __init__(self):
  10.         self.start_time = time.time()
  11.  
  12.  
  13.     def start_requests(self):
  14.         url = 'https://www.rusprofile.ru/id/2088578'
  15.         yield HtmlRequest(
  16.             url=url,
  17.             callback=self.parse_company,
  18.             cookies=cookies,
  19.         )
  20.  
  21.  
  22.     def parse_company(self, response):
  23.         page = response.request.meta['page']
  24.         html = page.html
  25.         print(html.xpath('//a[@itemprop="email"]/@href'))
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement