May-17-2020, 11:11 PM
I am trying to code an Instagram Bot using python and selenium.
I want to find an element using xpath
The Html path is as below:
<div class="_2ic5v">
<button class="wpO6b ZQScA" type="button">
<svg aria-label="Like" class="_8-yf5 " fill="#8e8e8e" height="12" viewBox="0 0 48 48" width="12"><path d="......."></path>
My best guess so far is find_elements_by_xpath('//button[@class="ZQScA"]/*[name()="svg"][@aria-label="Like"]')[0]
I want to find an element using xpath
The Html path is as below:
<div class="_2ic5v">
<button class="wpO6b ZQScA" type="button">
<svg aria-label="Like" class="_8-yf5 " fill="#8e8e8e" height="12" viewBox="0 0 48 48" width="12"><path d="......."></path>
My best guess so far is find_elements_by_xpath('//button[@class="ZQScA"]/*[name()="svg"][@aria-label="Like"]')[0]