Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import re
- import platform
- from bs4 import BeautifulSoup
- from selenium import webdriver
- accepted = set()
- browser = webdriver.PhantomJS()
- browser.get("https://star.fintender.ru/Search/Index/?id=6f571c46-c6fb-4454-af68-32f5831ca7f9&backinfo=1|l0116200007917004246-1")
- soup = BeautifulSoup(browser.page_source, "html.parser")
- print(soup)
- print(soup.findAll('table'))
- '''def request_response(url):#Посылаем запрос
- headers = {
- 'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0'
- }
- response = requests.get(url, headers=headers)
- return response.text
- def buyer_parse(url):#Собираем инфу о покупателеpip
- text = request_response(url)
- soup = BeautifulSoup(text,"lxml")
- customer_list = soup.findAll('span','customer')
- i=0
- while i < 3:
- print(customer_list[i].text)
- i+=1
- def link_creater(htmlpage):
- base='https://star.fintender.ru'
- file = open(str(htmlpage)+'.html','r',encoding='utf-8').read()
- links = re.findall(r'(/Search/GetActual/(\w|\?|\=|\-)+)',file)
- my_links=set()
- for link in links:
- my_links.add(link[0])
- for link in my_links:
- if base+link not in accepted:
- print(base+link)
- buyer_parse(base+link)
- accepted.add(base+link)
- print(' ')
- else:
- print('repeat')
- htmlpage=1
- while htmlpage < 16:
- link_creater(htmlpage)
- htmlpage+=1'''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement