Notorious 0 Posted August 7, 2016 Report Share Posted August 7, 2016 I’m a beginner trying to do my first bot.I’ve managed to get it to navigate to the page I want, then to click on to a further page, and then click on to another one.I’m trying to scrape information from this last page in the form of two lists which will go on to a table. It turns out that to get one of the lists to list the items in the right order, I have to click on a certain box – it doesn’t take me to a new page, it just arranges the order of the items on the page.When I try to use the “click” command here it doesn’t work, it just highlights items on the page. Is there another command I should be using here? Quote Link to post Share on other sites
pash 504 Posted August 7, 2016 Report Share Posted August 7, 2016 Please post your code. 1 Quote Link to post Share on other sites
Notorious 0 Posted August 8, 2016 Author Report Share Posted August 8, 2016 Sorry – just worked out how to do that. navigate("betting.racingpost.com","Wait")click(<id="nm_track_3">,"Left Click","No")click(<innertext="2:00 British Stallion Studs EBF Maiden Fillies' Stakes (Plus 10 Race) 7f50y">,"Left Click","No") So Line 1 takes me to the websiteLine 2 is supposed to take me to the first trackLine 3 is supposed to take me to the first race of the first track Across the top of the Race Card that we reach after Line 3 are some words which you can click on to change the order of the runners. I need to click on “NO.” – but I am not having much luck. I have also discovered another problem. The code for the racetrack and the races changes every day. So If I program it to work on one day, it won’t work the next. Ultimately what I am trying to do is scrape 2 or 3 bits of information on every horse in every race, every day. Quote Link to post Share on other sites
pash 504 Posted August 8, 2016 Report Share Posted August 8, 2016 I'm sorry, I understand a little navigate("http://betting.racingpost.com/","Wait") wait for browser event("Everything Loaded","") wait(1) click(<id="nm_track_3">,"Left Click","No") wait(1) click(<innertext="2:00 British Stallion Studs EBF Maiden Fillies' Stakes (Plus 10 Race) 7f50y">,"Left Click","No") Quote Link to post Share on other sites
Notorious 0 Posted August 8, 2016 Author Report Share Posted August 8, 2016 (edited) Thanks pasha – that made it work a lot better, and taught me some useful commands. I still have the problem though of not being able to click on the “NO.” at the top of the card on the final page – see my attachment (I’ve drawn a circle round it). navigate("http://betting.racingpost.com","Wait")wait for browser event("Everything Loaded","")wait(1)click(<id="nm_track_3">,"Left Click","No")wait(1)click(<innertext="2:00 British Stallion Studs EBF Maiden Fillies' Stakes (Plus 10 Race) 7f50y">,"Left Click","No")click(<undefined=undefined>,"Left Click","No") Edited August 9, 2016 by Notorious Quote Link to post Share on other sites
pash 504 Posted August 8, 2016 Report Share Posted August 8, 2016 navigate("http://betting.racingpost.com/","Wait") wait for browser event("Everything Loaded","") wait(1) click(<id="nm_track_3">,"Left Click","No") wait(1) click(<innertext="2:00 British Stallion Studs EBF Maiden Fillies' Stakes (Plus 10 Race) 7f50y">,"Left Click","No") wait for browser event("Everything Loaded","") wait(2) click(<id="sc_sort-no">,"Left Click","No") 1 Quote Link to post Share on other sites
Notorious 0 Posted August 8, 2016 Author Report Share Posted August 8, 2016 OK, I get it. Thanks pasha.Sorry for being so slow – I didn’t think of doing it that way. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.