Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fact = []
- div = soup.find_all('div', {'class': 'params'})
- if len(div) > 0:
- div = div[len(div) - 1]
- info = div.find('table', {'class': 'info'})
- if info is not None:
- td = (soup.find_all('td', {'class': 'card_info'}))
- if td is not None:
- td = td[2].find('table')
- if td is not None:
- td = td.find_all('a')
- if td is not None or td is not []:
- for t in td:
- fact.append(t.text)
- tr = info.find_all('tr')
- if len(tr) == 5:
- # print(h1.find('nobr').text)
- # print((tr[0].find_all('td'))[1].text)
- # print((tr[1].find_all('td'))[1].text)
- data = {
- 'mark': h1.find('nobr').text,
- 'weight': (tr[0].find_all('td'))[1].text,
- 'diam': (tr[1].find_all('td'))[1].text,
- "factories": fact
- }
- print("OOOKKKKK")
- print(data)
- print("---------------------------------------------------------------------------------->")
- return data
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement