danwagnerco / selenium-vba

Automatically exported from code.google.com/p/selenium-vba
1 stars 0 forks source link

"Get current address" & selenium.getAttribute help request #24

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Operating system : Win7
.Net Framework version : 2.0.7045
Office Version : 2003
SeleniumWrapper version : 1.0.11.0

1) Pls could you provide sample VBA code that will retrieve underlying link for 
a given cell in a table?

I was trying to use the following code, but with no luck :
selenium.getAttribute("xpath=//table[1]//tr[1]/td[1]@href")
(I get blank value)

2) Pls could you also provide sample VBA code that will return current 
http://www address as per address bar in the browser?
following the command:
selenium.Open "https://www.google.com"
"Selenium.getAddress" should return "https://www.google.co.uk", for example if 
get redirected to .co.uk domain

Original issue reported on code.google.com by steepd...@gmail.com on 11 Jun 2013 at 12:04

GoogleCodeExporter commented 9 years ago
> 1) Pls could you provide sample VBA code that will retrieve underlying link 
for a given cell in a table?
Your xpath query is incorrect as an href attribute is not available for a TD 
tag.
As a don't have your html source, I can only suggest a solution:
selenium.getAttribute("xpath=//table[1]//tr[1]/td[1]/a@href")

I recommend you to test your xpath in Firebug by using this command :
$x("//table[1]//tr[1]/td[1]/a@href");

> 2) Pls could you also provide sample VBA code that will return current 
http://www address as per address bar in the browser?
url = selenium.URL
or
url = selenium.getLocation()

Original comment by florentbr on 11 Jun 2013 at 2:01

GoogleCodeExporter commented 9 years ago

Original comment by florentbr on 8 Sep 2014 at 5:40