Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- elif 'drom.ru' in vin[4]:
- code = driver.page_source
- soup = BeautifulSoup(code, 'html.parser')
- prices = soup.find_all('div', class_='b-advItem__section b-advItem__section_type_price')
- print(vin[4])
- try:
- prices_sum = list(map(lambda x: int(re.sub('\D', '', x.div.text)), prices))
- except:
- prices_sum = []
- if len(prices_sum) != 0:
- print(sum(prices_sum)//len(prices_sum))
- # with vertica_python.connect(**conn_info) as connection:
- # cur = connection.cursor()
- # cur.execute("update vins set price = {pr} where vin = '{vin}';commit;".format(pr = sum(prices_sum)//len(prices_sum), vin=vin[0]))
- # vins = cur.fetchall()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement