Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6338119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:22:55+00:00 2026-05-24T19:22:55+00:00

(I have asked this question on the Scrapy google-group without luck.) I am trying

  • 0

(I have asked this question on the Scrapy google-group without luck.)

I am trying to log into Facebook using Scrapy. I tried the following in the interactive shell:

I set the headers and created a request as follows:

header_vals={'Accept-Language': ['en'], 'Content-Type': ['application/ 
x-www-form-urlencoded'], 'Accept-Encoding': ['gzip,deflate'], 
'Accept': ['text/html,application/xhtml+xml,application/xml;q=0.9,*/ 
*;q=0.8'], 'User-Agent': ['Mozilla/5.0 Gecko/20070219 Firefox/ 
2.0.0.2']}

login_request=Request('https://www.facebook.com/login.php',headers=header_vals) 

fetch(login_request) 

I get redirected:

2011-08-11 13:54:54+0530 [default] DEBUG: Redirecting (meta refresh) 
to <GET https://www.facebook.com/login.php?_fb_noscript=1> from <GET 
https://www.facebook.com/login.php> 

.
.
.

[s]   request    <GET https://www.facebook.com/login.php> 

[s]   response   <200 https://www.facebook.com/login.php?_fb_noscript=1> 

I guess it shouldn’t be redirected there if I am supplying the right
headers?

I still attempt to go ahead and supply login details using the
FormRequest as follows:

new_request=FormRequest.from_response(response,formname='login_form',formdata={'email':'...@email.com','pass':'password'},headers=header_vals)

new_request.meta['download_timeout']=180 

new_request.meta['redirect_ttl']=30 

fetch(new_request) results in:

2011-08-11 14:05:45+0530 [default] DEBUG: Redirecting (meta refresh) 
to <GET https://www.facebook.com/login.php?login_attempt=1&_fb_noscript=1> 
from <POST https://www.facebook.com/login.php?login_attempt=1>
.
.

[s]   response   <200 https://www.facebook.com/login.php?login_attempt=1&_fb_noscript=1> 

.

What am I missing here? Thanks for any suggestions and help.

I’ll add that I’ve also tried this with a BaseSpider to see if this was a result of the cookies not being passed along in the shell, but it doesn’t work there either.

I was able to use Mechanize to log on successfully. Can I take advantage of this to somehow pass cookies on to Scrapy?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T19:22:57+00:00Added an answer on May 24, 2026 at 7:22 pm

    Notice that “meta redirect” text near redirecting. Facebook has a noscript tag to automatically redirect clients without javascript to “/login.php?_fb_noscript=1”. The problem is that you’re posting to “/login.php” instead and always getting redirected by meta refresh header.

    Even if you get over this problem it’s against Facebook robots.txt, so you shouldn’t really be doing this.

    Why don’t you just use Facebook Graph API?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have asked this question in Radiant CMS google group, but no one answered
I have asked this question about using the a Linq method that returns one
I have asked this question so many times and have tried so many different
I have asked this question before and the problem was half solved in the
I have asked this question on Telerik forums with no reply so I'm turing
i asked this question yesterday but it doesnt seem to have asked properly so
I have just asked this question an hour ago but with regards to IE8
I am sorry I have already asked this question on Superuser, but nobody answers
I asked this question to multiple people and until now I do not have
I asked this question earlier. I am intrigued by std::set but I have another

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.