Issue with XPath in 'Negative-news' bot

I would like to run negative-news-search-bot on Chrome.
IE is the following with X-path specification of # 9.

I tried X-path on chrome, but it does not work.
Please tell me the X-path on Chrome

Hi @tamotsu_itoieq in the example above, the Xpath in step 9 is different - it is //*[@id=“rso”]//div[@class=‘r’]/a[1]. It works correctly in Chrome.

Thank you for your reply.
Is X-path at chrome //*[@id=“rso”]//div[@class=‘r’]/a[1] ?
Processing will stop with the following error

Caused by: org.openqa.selenium.InvalidSelectorException: invalid selector: Unable to locate an element with the xpath expression //[@id=“rso”]//div[@class=‘r’]/a[1] because of the following error:
SyntaxError: Failed to execute ‘evaluate’ on ‘Document’: The string '//
[@id=“rso”]//div[@class=‘r’]/a[1]’ is not a valid XPath expression.

It will work with the X-Path below, but I get only one result.

@tamotsu_itoieq Can you share the screenshot of the web element action that fails with this error?

It seems that it was my misunderstanding.

It worked without problem in the lower X-Path

Thank you

1 Like