leochabi / selenium-vba

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

Ctrl+a, Ctr+c in Firefox, selenium vba #93

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Operating system : windows 7
.Net Framework version : 4.5.1
Office Version : 2010
SeleniumWrapper version : v1.0.19.0
Language: VBA (out of Excel)

What is your issue ?

I would like to navigate to a web page, select all content on that page, copy 
it and then paste it into word.

Unfortunately, I cannot use Internet Explorer, and I have not been able to 
figure out the ctrl+a, ctrl+c in Firefox.

Thanks!!!

Original issue reported on code.google.com by thomas.n...@gmail.com on 9 Sep 2014 at 9:13

GoogleCodeExporter commented 8 years ago
To copy all:
Dim wd As New Webdriver, Keys As New Keys
wd.Start "firefox", "http://www...."
wd.Open "/"
wd.SendKeys Keys.Control, "a"
wd.SendKeys Keys.Control, "c"

Original comment by florentbr on 9 Sep 2014 at 9:47

GoogleCodeExporter commented 8 years ago
Thank you for the quick response! The code works but it selects only what is in 
the address field. How do I point the code to the body of the page and select 
everything there?

Original comment by thomas.n...@gmail.com on 10 Sep 2014 at 8:55

GoogleCodeExporter commented 8 years ago
wd.Open "/"
wd.findElementByTagName("body").SendKeys Keys.Control & "ac"

or

wd.Open "/"
wd.findElementByTagName("body").click
wd.SendKeys Keys.Control, "a"
wd.SendKeys Keys.Control, "c"

Original comment by florentbr on 18 Sep 2014 at 1:26