I am getting frustrated trying to find the xpath for the first "Read more" button in the review section of this website: https://www.tripadvisor.com/Hotel_Review-g60982-d209422-Reviews-Hilton_Waikiki_Beach-Honolulu_Oahu_Hawaii.html
I'm trying to scrape the reviews on my macbook, but keep getting an invalid syntax error. I was told that it's because the xpath isn't formatted correctly. All suggestions did not work.
I'm using selector gadget in Chrome, and this time I tried selecting an element with a div. This is what came out
//*[contains(concat( " ", @class, " " ), concat( " ", "eIVRK", " " ))]
Of course it did not work. Then I tried Chromes inspect element, and this is what it came up with
<div class="eIVRK" style="line-height: 20px;"><div class="dlJyA" data-test-target="expand-review"><span class="eljVo _S Z">Read more</span><span class="ui_icon caret-down zedZf"></span></div></div>
I have no clue what to do with this.
This also generated errors:
driver.find_elements(by=By.XPATH,'//*[@id="component_18"]/div/div[3]/div[3]/div[3]/div[3]/div[1]/div[2]/div').click()
File "/var/folders/6c/jpl964752rv_72zjclrp_8ym0000gn/T/ipykernel_24978/3907164188.py", line 8
driver.find_elements(by=By.XPATH,'//*[@id="component_18"]/div/div[3]/div[3]/div[3]/div[3]/div[1]/div[2]/div').click()
^
SyntaxError: positional argument follows keyword argument