Page 1 of 1
Merge Database Fields?
Posted: Sat Jul 09, 2011 1:10 pm
by iana1uk
Hi there,
Great software!
Is it possible to merge data fields? I am getting results back from a scraped web page that are ending up in 2 to 5 different fields as in the attached screen shot, the County for
Robin's Nest is shown as four different fields, where I would like them to be shown in the same field...
The page is at:
http://www.wales-cottages.info/brecon-b ... hay-on-wye
thanks in advance,
Ian.
Re: Merge Database Fields?
Posted: Sat Jul 09, 2011 7:28 pm
by webmaster
Hi,
The problem there is in the "county" kind. It's selecting many elements per page. You are most likely taking it from the title on the top. The difficulty is in the fact the each word is a single HTML element. The reason why you "location" kind works properly is because you always used the first word, so this is how Helium Scraper recognizes it. But you created the "county" kind by selecting words that are on different places, so Helium Scraper is just selecting every (bold) word. The easiest solution would be to use the whole second line by selecting any word in there and using the "Select parent" button in the selection panel until the "SPAN" element is selected, which contains the whole line.
Also, a JavaScript gatherer could be written that would select from that second line whatever is before a comma, or after a comma, or between two commas. Remember that, even though you can configure Helium Scraper to extract just anything you want, this needs to be distinguishable on every page being scraper by some mean (such as being before a comma, or between two, etc.). If you need help with JavaScript just let me know and I'll be glad to help.
Another option would be to take the county from the line on the top where the text "Home > Welsh destinations > Brecon Beacons and Mid Wales > Wye Valley and Area" is written (in the URL you posted).
Re: Merge Database Fields?
Posted: Sun Jul 10, 2011 10:34 pm
by iana1uk
Hi, thanks for the reply. I went with the third option and all is working as it should. It just felt a bit like "cheating"!
I'm lazy by nature so I only wanted to javascript code if strictly necessary!
Second option of navigating using the select parent button didn't seem to find it, it is some weird kind of html coding with <cufon> tags whatever they are.
Again, thanks for your help.