SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
Mokalake
Calcite | Level 5

Good day,

 

Is there a way in which i can web scrap with sas enterprise guide?

 

Here is what i need to achieve " suppose i have a column field with word phrases that i want to pass to google chrome and maybe extract the contents of their home page. E.G i have the word SAS and i want the contents of the ABOUT US from the first link"

 

Thank you.

4 REPLIES 4
Ksharp
Super User

Maybe you need help from the third side software cURL .

ybolduc
Quartz | Level 8

Hi Mokalake,

 

     SAS may not be the best tool to do Web Scraping the way you want to do it. But if you really way do this with SAS, you will need to use PROC HTTP to download the page. Once you have the page downloaded, the best would be to use Regular Expressions to find the information that you are looking for. You will likely need to use SAS Macros to wrap your logic and make iterate properly.

 

     Note that both PROC HTTP and Regular Expressions are fairly advanced skills in SAS.

 

Thanks,

 

Reeza
Super User
You can and it's been done and I've done some of this. You can search on lexjansen.com for some full papers on the topic or Chris Hemidinger has a blog post on it as well. There are some posts on here that also asked this question and have solved answers that may help you. I'd highly recommend starting there.

https://blogs.sas.com/content/sasdummy/2017/12/04/scrape-web-page-data/

BUT...it's possible your system may be locked down and may not let you do some of these things. EG can often be locked down pretty hard.
Mokalake
Calcite | Level 5

Thank you. I will have a look at it.

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 968 views
  • 0 likes
  • 4 in conversation