Hi,
Presently I am working on a project which requires to read data from Website into SAS Contextual Analysis.
The objective is to find out whether one of client customers name is appearing on a given website.
One of the websites from which we need to read the data is "https://www.moneycontrol.com/news/"
I need some advice on how to read data from websites using SAS Visual Analytics or any other SAS tools and
How to Create a dataset from extracted data and pulling in data set to SAS Contextual Analysis.
Urgent advice is needed.
Thanks
Rakesh Kumar
Contact - +91-9008964466
Hi Rakesh,
I think you can use PROC HTTP to extract the tags from a websites and then use any pattern matching technique to find the common pattern and set a status as Success or some flag.
For example:
filename src temp;
proc http
method="GET"
url= "https://www.moneycontrol.com/news/"
out=src;
run;
data rep;
infile src length=len lrecl=32767;
input line $varying32767. len;
line = strip(line);
if len>0;
run;
data _Trials_(drop=recordline record nextpage);
length Status $25 ;
retain Status;
retain recordLine 0; *=1 means this line may contain needed information;
set rep;
if prxmatch('/>Study</i',line) then recordLine=1;
if (recordLine=1) then do; *now get the related information;
if prxmatch('/>Study</i',line) then status='Success';
run;
So in the above fashion you might try to search something inside the parser as per your requirement and if you want to store the number of occurrences of the same word then you can use the call prxnext.
Thanks and Gud luck.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.
Find more tutorials on the SAS Users YouTube channel.