I'm trying to scrape the information from data-asin under the main class
<div class = "s-main-slot s-result-list s-search-results sg-row">
I need the data from the first six asins as: B081G75GPQ, B081FBQZ95, B084HZ7PV3, B084HZFBRZ, B087N66CJT,B07TYQ3KYX and to paste them on a row in excel.
Until now I tried this but isn't working, in there another way to access this info and copy in excel?
elements = driver.find_elements_by_class_name(
's-main-slot s-result-list s-search-results sg-row')
for e in elements:
print(e.get_attribute('data-asin'))
else:
print('not found')