Hello all
I got the task of organizing the records for powerlifting club. This basically ends up being going to a webpage and clicking through drop down menus to pick age and weight classes. I then find my club’s name and copy the relevant information to a spreadsheet.
This was not too much work to do manually, but I’m afraid of making mistakes in the future.
I’m getting stuck on the part of searching for text in Google Chrome.
The code works so far, but I don’t seem to be able to search for text on the page.
I thought another idea would be to copy the text to a text file and search there, but the extra steps seemed unnecessary if there was a better way.
tell application "Google Chrome" to activate
tell application "System Events"
tell process "Google Chrome"
open location "http://webpage.com"
delay 1 -- let the page load
end tell
end tell
-- There's a lot of stuff here to select from drop down menus etc.
tell application "Google Chrome"
select all of active tab of window 1
copy selection of active tab of window 1
if selection contains "Our Club Name" then
-- get the person and their record which should be the text right before and after this
end if
end tell
The copy selection part works if I want to paste it into a text document, but I’m trying to avoid extra steps.
Browser: Safari 537.22
Operating System: Mac OS X (10.8)