HTTP requests and cookies

  • Автор темы Автор темы myndeswx
  • Дата начала Дата начала

myndeswx

Client
Регистрация
15.05.2017
Сообщения
437
Реакции
104
Баллы
43
Hello, trying to automate freenom.com registration with http requests, with cookies everything is good,
but in fiddler (when making manual request) i can see such parameter
'token' 40 random strings .

I have never had experience with it, any sources about how to emulate it?
Is it even possible without real browser?

Thank you
 
Have you tried to pick browser cookie with c# code?

Код:
Развернуть Свернуть Копировать
instance.ActiveTab.Navigate("http://google.com/");
instance.ActiveTab.WaitDownloading();
// get cookie by domain
// to do this you must have a variable with name "cookie"
project.Variables["cookie"].Value = instance.GetCookie("google.com", true);

Insert new action Post, open element proprieties, open tab "more" change headers value to user settings, at cookie write {-Variable.cookie-}
 
Yes, @SOS Cartões i have tried this, and this does work to get some cookies but the token is generated at the very end of the process , so if i wanted to get token from browser i had to make 80% of the code on browser not http reqests
 
The token a part of the cookie?
 
The token a part of the cookie?
no, not really, it's in the data that's being posted, no idea how it is generated
5md5EzvhvvodK2.jpg
 
Well, sometimes I use regex inside cookie to take specific element...
Cookie:
Код:
Развернуть Свернуть Копировать
lumUserLocale=pt_BR; lumUserSessionId=lCCGc_D8Q1dwhKhlTfsZpPqo8YyhkkBK; lumUserName=LUIS+CARLOS; accessToken=lCCGc_D8Q1dwhKhlTfsZpPqo8YyhkkBK; lumUserLogin="VRPAT#supetnt7@gmail.com"; JSESSIONID=I9L7LIv-dp4REEAcSrAEPhyB

Regex:
Код:
Развернуть Свернуть Копировать
(?<=\ accessToken=).*?(?=;)

Result:
Код:
Развернуть Свернуть Копировать
lCCGc_D8Q1dwhKhlTfsZpPqo8YyhkkBK


So, if the "token" is generated at "end of your process" you will need to .getcookie in the end of process.... some languages make it very hard to take, I have too many dificulty to grab instance from AngularJS v2 websites.
 
I do understand this, but the main question is - do i have to use browser
or is it possible to make this only with http requests
 
You must use browser to generate cookie, you can use http get or http post to do requests.
 
Understood. Thank you
 

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)