Scrape website property search results linked pages into excel (PC or MAC)

SGMacro

New Member
Joined
Jul 11, 2015
Messages
16
Excel VBA newbie looking to scrape property search results linked pages into excel.

I have read a few of the articles here and viewed a few videos online to help me understand how this is done and gave it a go using this property search.

The method I used was to save the webpage as a text file and then import into excel using data-import file feature which worked fine for the search results.

The problem is that the data I need is contained within each specific properties page and can only be accesses by clicking the link within each property advert.

I have right clicked the button and selected "inspect element" which shows the following link:
a href="/property-to-rent/property-52985195.html">£110 pw<span class="grey-text price-pipe price-pipe-small">|</span>
£477 pcm</a>

The bold text is consistent across all items property results, causing the relevant property webpage to open and I am wondering if this can be used to point some VB code to search all items on the webpage containing this, and pull the required data into excel:confused:

This is the first time I have looked into doing this so not sure where start and would welcome any help, thoughts, ideas, etc.
 
Last edited:

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Once you have the source code of the page you can do a search in each line of hthe text file for your href="/Prperty-to-rent"

loop through each line storing the line in a string variable sLine
then
Code:
dim sLine as string
...
'get each line into sLine
...
dim lL as long
lL = Instr(sLine,"href=""/property-to-rent/") 'lL will be 0 if not found
if lL then
   sLink=Mid(sLine,lL+6,Instr(lL,sline,"""")-(lL+6))
   ' sLink should now contain /property-to-rent/property-52985195.html
   ... do whatever
end if
 
Upvote 0

Forum statistics

Threads
1,216,466
Messages
6,130,795
Members
449,593
Latest member
morpheous

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top