vinnyuk 1 Posted January 21, 2015 Report Share Posted January 21, 2015 Hi Ubotters I need your help! I am trying to scrape the results page which appears when you request a quotation from http://www.flexicover.co.uk Now here is my problem, Some times policies Bronze, Silver, Gold & Platinum appear and other times only maybe Brionze & Gold So what happens is this Bronze could be data-quoteindex="1"> and another time Gold could be data-quoteindex="1"> I need a way of scraping the price and the package name e.g. Gold or Silver in a organised table Any help would be much appreciated Quote Link to post Share on other sites
Ptrick125 45 Posted January 21, 2015 Report Share Posted January 21, 2015 Could you separate the different packages by table, div, or another attribute like a background color? Quote Link to post Share on other sites
vinnyuk 1 Posted January 21, 2015 Author Report Share Posted January 21, 2015 Hi Ptrick125 I cannot find any attributes to separate this It is a real challenge this one Quote Link to post Share on other sites
arunner26 51 Posted January 21, 2015 Report Share Posted January 21, 2015 vinnyuk,I would start with something like the code below.I ran it on a couple of scenarios on http://www.flexicover.co.uk and it let's me know what the page has on it. set(#BronzeFound, $nothing, "Global")set(#SilverFound, $nothing, "Global")set(#GoldFound, $nothing, "Global")set(#PlatinumFound, $nothing, "Global")set(#BrowzeFound, $scrape attribute(<innertext="Bronze">, "innertext"), "Global")set(#SilverFound, $scrape attribute(<innertext="Silver">, "innertext"), "Global")set(#GoldFound, $scrape attribute(<innertext="Gold">, "innertext"), "Global")set(#PlatinumFound, $scrape attribute(<innertext="Platinum">, "innertext"), "Global") Then I would alter what I do: IF this found THEN Do thisIF that found THEN Do that, etc... You could have lots of IF statements or you could be clever and create code that is dynamic to what was found. 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.