BigEfromDaBX 25 Posted August 3, 2013 Report Share Posted August 3, 2013 How do I scrape the options on a drop down list. I want to be able to get all the options on a particular drop down. Thanks. Quote Link to post Share on other sites
UBotDev 276 Posted August 3, 2013 Report Share Posted August 3, 2013 I think you should check this thread (it solves scraping dropdown with REGEX): http://www.ubotstudio.com/forum/index.php?/topic/14576-scrape-a-dropdown-menu/&do=findComment&comment=81415 Hopefully it helps. 1 Quote Link to post Share on other sites
BigEfromDaBX 25 Posted August 3, 2013 Author Report Share Posted August 3, 2013 I think you should check this thread: http://www.ubotstudio.com/forum/index.php?/topic/14576-scrape-a-dropdown-menu/&do=findComment&comment=81415 Hopefully it helps.REGEX!!!! I been avoiding that like a plague. I guesss im going to have to learn it lol. Thanks Quote Link to post Share on other sites
UBotDev 276 Posted August 3, 2013 Report Share Posted August 3, 2013 Don't be afraid of REGEX, it's the most useful thing for scraping and you'll need it sooner or later, so I suggest you start learning. I must admit that patterns look really bad, but if you construct them on your own they all make sense. However, you could also solve that without REGEX...for the page that we discussed there you could use code bellow: navigate("http://www.adoos.com/posting/", "Wait") wait for element(<name="geo1_id">, "", "Appear") set(#TMP HTML, $scrape attribute(<name="geo1_id">, "outerhtml"), "Global") load html(#TMP HTML) clear list(%statesscraped) add list to list(%statesscraped, $scrape attribute(<tagname="option">, "innertext"), "Delete", "Global")Notice that you need to open scraped HTML in a browser because you can't directly scrape "options" tag name from that page, because it includes multiple dropdowns. If there would be only 1 dropdown on the page you could simply use this code: clear list(%statesscraped) add list to list(%statesscraped, $scrape attribute(<tagname="option">, "innertext"), "Delete", "Global") 1 Quote Link to post Share on other sites
BigEfromDaBX 25 Posted August 3, 2013 Author Report Share Posted August 3, 2013 Don't be afraid of REGEX, it's the most useful thing for scraping and you'll need it sooner or later, so I suggest you start learning. I must admit that patterns look really bad, but if you construct them on your own they all make sense. However, you could also solve that without REGEX...for the page that we discussed there you could use code bellow: navigate("http://www.adoos.com/posting/", "Wait") wait for element(<name="geo1_id">, "", "Appear") set(#TMP HTML, $scrape attribute(<name="geo1_id">, "outerhtml"), "Global") load html(#TMP HTML) clear list(%statesscraped) add list to list(%statesscraped, $scrape attribute(<tagname="option">, "innertext"), "Delete", "Global")Notice that you need to open scraped HTML in a browser because you can't directly scrape "options" tag name from that page, because it includes multiple dropdowns. If there would be only 1 dropdown on the page you could simply use this code: clear list(%statesscraped) add list to list(%statesscraped, $scrape attribute(<tagname="option">, "innertext"), "Delete", "Global") Thanks I donwloaded the editpad lite and watched the three video tutorials on REGEX. I got it now. Wasnt as bad as i thought 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.