FAO VBA Chrome Selenium Guru's
#1
I wonder if you can help me please.

I'm trying to write a bit of VBS code in Excel to populate web forms

The website is similar to this one with a login and then I want to be able to send private messages

I have to use the Shell function to be able to by-pass the login screen (once already logged on to the site)

Where I am stuck, is with the webpage opened, how do I continue the code to enter data into the subject box etc? I can see the box name is "subject" but it's the code to find it I am lost with.




Dim driver As New selenium.ChromeDriver
Dim ChromeLocation As String
Dim MyURL As String


Dim ws1 As Worksheet
Dim lastRow As Long

Range("A1").Select      'This contains the URLs.  Using user Supamart as an example, the URL to send him a PM is https://wbaunofficial.org.uk/private.php...nd&uid=304 and that is located in cell A1 


Dim ws1 As Worksheet
Dim lastRow As Long

Range("A1").Select

lastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row

Set ws1 = Sheets("rawdata")

ChromeLocation = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" 'Location of Chrome.exe in your PC

For i = 1 To lastRow

MyURL = ws1.Cells(i, 1)

lastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row

Set ws1 = Sheets("rawdata")

ChromeLocation = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" 'Location of Chrome.exe in your PC

For i = 1 To lastRow

MyURL = ws1.Cells(i, 1)



***************************

I know code to use if I was using the following commands


Sub TestSelenium()

Set cd = New selenium.ChromeDriver

cd.Start
cd.Get "https://www.wbaunofficial.org.uk"

But that will take me to the login page and trying to locate the login button is a nightmare with no name, id, etc etc 





So... is there a way I can use the shell function as above (once logged in) and the top code runs, opens the message page and then enters the subject and message content from cells b1 & c1?



Thanking you in advance.
Reply


Messages In This Thread
FAO VBA Chrome Selenium Guru's - by Fulham Fallout - 09-08-2022, 04:54 PM
RE: FAO VBA Chrome Selenium Guru's - by waffle - 09-08-2022, 05:53 PM
RE: FAO VBA Chrome Selenium Guru's - by hudds - 02-16-2023, 08:09 PM
RE: FAO VBA Chrome Selenium Guru's - by SophLad - 09-08-2022, 06:20 PM
RE: FAO VBA Chrome Selenium Guru's - by SophLad - 09-09-2022, 11:46 AM
RE: FAO VBA Chrome Selenium Guru's - by Tom Joad - 02-16-2023, 08:08 PM

Forum Jump:


Users browsing this thread: