BookmarkSubscribeRSS Feed
jhirschb
Calcite | Level 5

The code below only loads 43 lines of the web-site data to scrape.

filename output temp;  * Setup a scratch file ; 

%Let sub = Airport%20West;

proc http url="http://reiv.com.au/market-insights/suburb/&sub" method="get"
out=output;
run;
*
Create a data set called first with one variable for the contents of the
webpage called value
;
data first;
length suburb $ 20;
suburb = "&sub";
suburb = tranwrd(suburb, "%20", " ");
length value $30000;
infile output _infile_ = line;
input @1 value $30000.;
linenum = _n_;
output;
label
value = webpage code
suburb = "Name of suburb with %20 replaced by space"
linenum = Line number of code;
run;

  How do I get it to set aside sufficient space for up to 1000 lines of code from this website?

Thanks,  Joe 

4 REPLIES 4
Kurt_Bremser
Super User

You get the whole HTML content (the last observation contains the </html> tag), and it seems what you get is a script supposed to actually fetch the data, something I don't know if it's doable with PROC HTTP.

Kurt_Bremser
Super User

After trying the URL in Safari, you first get one of those "I am not a robot" pages, and after verification are routed to the actual data.

You should get in touch with the operators of the website, if they provide a dedicated download method for their data.

jhirschb
Calcite | Level 5
This is not the case when using SAS on machines that have it installed. Do you figure it is a location problem since our local machines are on a vpn located in Melbourne?
Where does the SAS ondemand login from?

Thanks, Joe
Kurt_Bremser
Super User

@jhirschb wrote:
This is not the case when using SAS on machines that have it installed.

Once you visited the page "manually" from such a computer, the "I am not a robot" script is circumvented because the necessary cookie is present.

Visit the page from your PC, save the HTML, then upload it to On Demand, so you can play around with it there.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 479 views
  • 0 likes
  • 2 in conversation