Merge Database Fields?

Questions and answers about anything related to Helium Scraper
Post Reply
iana1uk
Posts: 6
Joined: Sat Jul 09, 2011 1:01 pm

Merge Database Fields?

Post by iana1uk » Sat Jul 09, 2011 1:10 pm

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.
Attachments
Capture.jpg
Capture.jpg (47.73 KiB) Viewed 2107 times

webmaster
Site Admin
Posts: 495
Joined: Mon Dec 06, 2010 8:39 am
Contact:

Re: Merge Database Fields?

Post by webmaster » Sat Jul 09, 2011 7:28 pm

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).
Juan Soldi
The Helium Scraper Team

iana1uk
Posts: 6
Joined: Sat Jul 09, 2011 1:01 pm

Re: Merge Database Fields?

Post by iana1uk » Sun Jul 10, 2011 10:34 pm

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.

Post Reply