I'm trying to generalize much as possible a code in order to scrape eBay website. I am now stuck in this situation:
this is the following URL where I start:
https://www.ebay.co.uk/sch/i.html?_from=R40&_nkw=iphone+12&_oac=1
I want to click on the "More filters" button and then select specifically the 'Brand' option and get the list of the available brands.
This is what I was able to do till now:
url = 'https://www.ebay.co.uk/sch/i.html?_from=R40&_nkw=iphone+12&_oac=1'
driver = webdriver.Chrome()
driver.get(url)
driver.find_element_by_id('s0-14-11-0-1-2-6-2').click()
after click() the sub panel is open and I get what I need to change:
<div role="tab" class="x-overlay-aspect " data-aspecttitle="aspect-Brand" aria-selected="false" aria-controls="refineOverlay-subPanel" id="c3-mainPanel-Brand"><span class="x-overlay-aspect__label">Brand</span><svg focusable="false" aria-hidden="true" class="x-overlay-aspect__check-icon svg-icon icon-check" role="img" aria-label="Filter applied"><use xlink:href="#svg-icon-check"></use></svg></div>
if I select manually (i.e. clicking with the cursor) on 'Brand' here is what I get back:
<div role="tab" class="x-overlay-aspect active" tabindex="0" data-aspecttitle="aspect-Brand" aria-selected="true" aria-controls="refineOverlay-subPanel" id="c3-mainPanel-Brand"><span class="x-overlay-aspect__label">Brand</span><svg focusable="false" aria-hidden="true" class="x-overlay-aspect__check-icon svg-icon icon-check" role="img" aria-label="Filter applied"><use xlink:href="#svg-icon-check"></use></svg></div>
Unfortunately, I barely know Javascript so, althought there are other similar posts, I don't know how to keep going from here in order to get finally the information I need.
I hope you can help and I thank you in advance!