I am doing a get from google search pages and the code is something linke this :
Code:
//There's code before
while ((read(sockfd,buf , sizeof(buf)-1))) {
clean_buf(buf);
}
void clean_buf(char *buf){
// buf holds the raw html line
char buf[1000];
// this stores 1 link
char link[1000];
char *start = strstr(buf, "<a href");
start = strchr(start+1, '>')+1;
char *end = strstr(buf, "</a>");
memset(link, 0, 1000);
memcpy(start, link, end-start);
printf("%s\n",link); //Here is where i want to print the links
}