Jump to content

Recommended Posts

Posted (edited)

How should I be attempting to click this link?

image.png.31a0606191612d39c9063a9d3e63268c.png

<span id="x2m8_R-s" class="s_22 s-text">Walk&nbsp;In</span>

If I double click the Walk$nbsp;In the text reads Walk In.

image.png.d3e2aa589cd5c136349a9a9e1c1b6c8f.png

How can I search for this text? 

I have tried a several  different ways with no luck. Here are a few;

$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, '//span[text()="Walk${nbsp}In"]')


$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//span[translate(text(), '\u00a0', ' ') = 'Walk In']")


$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//span[contains(text(),'Walk In')]")


$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//span[contains(text(),'Walk&nbsp;In')]")

Any help is appreciated as always. 

 

 

 

Edited by SkysLastChance

You miss 100% of the shots you don't take. -Wayne Gretzky -Michael Scott

  • SkysLastChance changed the title to Chrome Webdriver - No Break Space   " "
  • Solution
Posted (edited)

Try this

$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//span[contains(text(),'Walk" & Chr(160) & "In')]")

btw.
why you are not using ID ?

$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//span[@id='x2m8_R-s']")

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

This also works.

 

$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//span[substring(@id, string-length(@id) - string-length('_R-s') + 1 ) = '_R-s']")

 

You miss 100% of the shots you don't take. -Wayne Gretzky -Michael Scott

Posted (edited)
  On 12/15/2021 at 10:58 PM, mLipok said:

Try this

$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//span[contains(text(),'Walk" & Chr(160) & "In')]")

 

Expand  

Is it working ?

EDIT: 
I see now.

  On 12/16/2021 at 2:34 PM, SkysLastChance said:

The first method did work. 

Expand  

Thanks

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...