I'm trying to get my instagram "following" list using only http component. I've tried to use lHTTP.Get('https://www.instagram.com/Myusername/following/');
but there are no usernames in the decrypted html. However, I saw some guys using it without instagram api, just http response in VB.Net. I'm using Delphi 10.
UPDATE
procedure TForm1.Button4Click(Sender: TObject);
var
lHTTP: TIdHTTP;
IdSSL: TIdSSLIOHandlerSocketOpenSSL;
Params, login : TStrings;
Reply, Token, X: string;
Cookie: TIdCookie;
begin
try
Params := TStringList.Create;
Params.Add('username=' + Edit1.Text);
Params.Add('password=' + Edit2.Text);
lHTTP := TIdHTTP.Create(nil);
try
IdSSL := TIdSSLIOHandlerSocketOpenSSL.Create(lHTTP);
IdSSL.SSLOptions.Method := sslvTLSv1;
IdSSL.SSLOptions.Mode := sslmClient;
lHTTP.IOHandler := IdSSL;
lHTTP.ReadTimeout := 30000;
lHTTP.HandleRedirects := True;
lHTTP.Request.UserAgent := 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.76 Mobile Safari/537.36';
lHTTP.Get('https://www.instagram.com', TStream(nil));
Cookie := lHTTP.CookieManager.CookieCollection.Cookie['csrftoken', 'www.instagram.com'];
if Cookie <> nil then
Token := Cookie.Value;
try
lHTTP.Request.CustomHeaders.Values['X-CSRFToken'] := Token;
lHTTP.Request.CustomHeaders.Values['X-Instagram-AJAX'] := '1';
lHTTP.Request.CustomHeaders.Values['X-Requested-With'] := 'XMLHttpRequest';
lHTTP.Request.Referer := 'https://www.instagram.com/';
lHTTP.Request.ContentType := 'application/x-www-form-urlencoded';
lHTTP.Request.UserAgent := 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.76 Mobile Safari/537.36';
Reply := lHTTP.Post('https://www.instagram.com/accounts/login/ajax/', Params);
finally
end;
finally
end;
Finally
lHTTP.Request.UserAgent := 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.76 Mobile Safari/537.36';
lHTTP.Get('https://www.instagram.com/myusername/following/', TStream(nil));
Memo1.Lines.Add(Reply);
Finally
end;
end;
end;
TIdHTTP
in Delphi. Please show the actual code you have tried that is not working for you. This is not unlike your other Instagram issue.lHTTP.Get('https://www.instagram.com/Myusername/');
to get the access token. Finally get thelHTTP.Get('https://www.instagram.com/Myusername/following/');
but there is no usernames in the decrypted html, i dont think this the right method @RemyLebeauTIdHTTP
with the right code, so you have to be missing something.https://www.instagram.com/Myusername/following/
. but there is no usernames in the source code while there is in the webpage itself. However, i've updated the post @RemyLebeau