Answer the question
In order to leave comments, you need to log in
How to scrap this site?
Everyone will accept, there is an authorization to the evernote notes site. Now you need to parse all the names of the notes (only the names, without the notes themselves)
He himself suffered far from 1 day. The freelancer suffered for 2 days. Created new projects on freelance exchanges (including those from Habr) and also still zeros.
Here is the authorization code
using (var request = new Leaf.xNet.HttpRequest())
{
// request.Cookies = new CookieDictionary();
request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36";
request.ConnectTimeout = 15 * 1000;
request.AllowAutoRedirect = false;
request.IgnoreProtocolErrors = true;
string get = request.Get("https://www.evernote.com/Login.action").ToString();
string hpts = Pars(get, "hpts\").value = \"", "\"", 0);
string hptsh = Pars(get, "hptsh\").value = \"", "\"", 0);
string source_page = Pars(get, "_sourcePage\" value=\"", "\"", 0);
string fp = Pars(get, "__fp\" value=\"", "\"", 0);
request.AddHeader("sec-ch-ua", "\" Not;A Brand\"; v = \"99\", \"Google Chrome\"; v = \"91\", \"Chromium\"; v = \"91\"");
request.AddHeader("Accept", "application/json, text/javascript, */*; q=0.01");
request.AddHeader("X-Requested-With", "XMLHttpRequest");
request.AddHeader("sec-ch-ua-mobile", "?0");
request.AddHeader("Origin", "https://www.evernote.com");
request.AddHeader("Sec-Fetch-Site", "same-origin");
request.AddHeader("Sec-Fetch-Mode", "cors");
request.AddHeader("Sec-Fetch-Dest", "empty");
request.Referer = "https://www.evernote.com/Login.action";
request.AddHeader(HttpHeader.AcceptLanguage, "en-EN,en;q=0.9,en-US;q=0.8,en;q=0.7");
string post = request.Post("https://www.evernote.com/Login.action", "username=" + txtLogin.Text + "&password=" + txtPassword.Text + "&login=&login=%D0%92%D0%BE%D0%B9%D1%82%D0%B8&hpts=" + hpts + "&hptsh=" + hptsh + "&analyticsLoginOrigin=login_action&clipperFlow=false&showSwitchService=true&usernameImmutable=false&_sourcePage=" + source_page + "&__fp=" + fp, "application/x-www-form-urlencoded; charset=UTF-8").ToString();
if (request.Response.Location.Contains("AnalyticsPitStop"))
{
// Тут парсинг названий всех заметок и вывод их в txtLog
}
else if (post.Contains("Incorrect password"))
{
MessageBox.Show("Неверноый логин или пароль");
}
else
{
MessageBox.Show("Ошибка 1");
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question