Hello. New here.
I have a question. How do I "download" HTML text and send it to a variable?
Code:
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int html_text;
html_text <-- get HTML text form e.g google.com
printf(html_text);
system("PAUSE");
return 0;
}
My second question is almust the same.
Code:
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int send;
scanf("%d", &send);
URL google <-- send;
system("PAUSE");
return 0;
}
It will be like urllib2 as in python.
Code:
import urllib, urllib2, cookielib
username = 'myuser'
password = 'mypassword'
cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
login_data = urllib.urlencode({'username' : username, 'j_password' : password})
opener.open('http://www.example.com/login.php', login_data)
resp = opener.open('http://www.example.com/hiddenpage.php')
resp.read()
Thx for anwsers.
P.S it must have a cookie function so I cannot loggout automatic.