New Member
May 11, 2021
Hi Guys,
when using
//img[contains(@alt, "air")]
as query on xpath chrome on one of the website, I am getting the image in highlights
however when I use the same syntax on VB
findelementbyxpath ("//img[contains(@alt, 'air')]
it is not able to find the element and popping an error.
Any suggestions please.
Power Query
Power Pivot
Xtreme Pivot Tables
Excel for Decision Making
Excel for Finance
Excel Analysis Toolpak
Power BI
Excel
Word
Outlook
Excel Expert
Excel Customer Service
PowerPoint
November 8, 2013
New Member
April 17, 2024
It seems like there might be a syntax or quoting issue in your VB code. When using XPath in VB, you need to make sure that the syntax is correct and that the quotes are properly formatted. Here's the corrected version of your code:
.FindElementByXPath("//img[contains(@alt, 'air')]")
In VB, you can use either single quotes (' ') or double quotes (" ") to enclose the XPath expression. Make sure that you are using the correct quotes and that there are no syntax errors in your code. Additionally, ensure that you are calling the `FindElementByXPath` method correctly within your VB script.
If you continue to encounter errors, double-check the XPath expression for accuracy and verify that the element you are trying to locate actually exists on the webpage. If the issue persists, providing more context or the specific error message you're receiving would help in diagnosing the problem further.
1 Guest(s)