I'm want to parse some info from the page, but have some troubles, becouse i cant parse something without id or class. Now i have tag div with image inside and some text (numbers) i need to get this numbers, but this div have only style tag and i cant use this style tag coz he always changing.
I have something like game site auction and trying to parse name of the item, price and link. But now i can get only names.
im trying to find all 'a' for div with father class. im trying to find hrefs im trying to find by style
def rshp_parse (base_url, headers):
session = requests.Session()
request = session.get(base_url, headers=headers)
if request.status_code == 200:
soup = bs(request.content, 'html.parser')
divs = soup.find_all('div', class_={'shop-search-row'})
for div in divs:
title = div.find('span').text
price = div.find('div')
href = div.find('a', class_={'champions_container'})['href']
# href = soup.find('div', style='color:#FFFFFF;text-decoration:none')
HTML
<div style="display:inline-block;width:15%;line-height:50px;vertical-align:top;white-space: nowrap;">
<img src="/assets/rpc/shard.png" style="width:20px">35,000
</div>
35,000 - its what im needed
<a href="/market/auction/1227124" target="_blank" style="color:#FFFFFF;text-decoration:none">
and this link