title: How to scrape a closed facebook group that I have credentials for with facebook_scraper
body: <p>I'm using facebook_scraper to try to scrape a closed group that I'm a member of.</p>
  
  <p>With my credentials logging in, it's working with my private groups <strong>that are not searchable</strong>, but not with private groups <strong>that are searchable</strong> (by searchable I mean that if you're not a member of the group and you type its name into the searchbar it will show up with some information, but not the posts or discussion, whereas unsearchable groups won't show up at all and if you type in their specific url you're redirected to login)</p>
  
  <p>I think the reason for this is because when the url for an unsearchable group is entered you are immediately redirected to a login page and so the login works, whereas searchable groups show some information and the scraper is just scraping that.</p>
  
  <p>Following the <a href="https://github.com/kevinzg/facebook-scraper" rel="nofollow noreferrer">GitHub</a> repo for facebook-scraper I think I've located the problem at:</p>
  
  <p><code>facebook_scraper.page_iterators.generic_iter_pages(url, GroupPageParser, FacbookScraper.get)</code></p>
  
  <p>The issue becomes more apparent at:</p>
  
  <p><code>facebook_scraper.page_iterators.GroupPageParaser(url).get_html().find('article')</code></p>
  
  <p>Which returns an empty list if the group is searchable and a populated list if it isn't</p>
  
  <p>A full example of my stalled debugging with the two actual groups I'm in:</p>
  
  <pre><code>&gt;&gt;&gt; from facebook_scraper import FacebookScraper, page_iterators
  
  &gt;&gt;&gt; scraper = FacebookScraper()
  &gt;&gt;&gt; parser = page_iterators.GroupPageParser
  
  &gt;&gt;&gt; credentials = (myemail@email.com, mypassword)
  &gt;&gt;&gt; scraper.login(credentials[0], credentials[1]) #It's not a login problem except for with the searchable groups
  
  &gt;&gt;&gt; searchable_url = 'https://m.facebook.com/groups/1401745746503709'
  &gt;&gt;&gt; unsearchable_url = 'https://m.facebook.com/groups/618892088578525'
  
  &gt;&gt;&gt; searchable_get = scraper.get(seachable_url)
  &gt;&gt;&gt; unsearchable_get = scraper.get(unsearchable_url)
  
  &gt;&gt;&gt; searchable_html = parser(searchable_get).get_html()
  &gt;&gt;&gt; unsearchable_html = parser(unsearchable_get).get_html()
  
  &gt;&gt;&gt; searchable_get.html
  &lt;HTML url='https://m/facebook.com/groups/1401745746503709' #This stays the same
  &gt;&gt;&gt; unsearchable_get.html
  &lt;HTML url='https://m.facebook.com/groups/618892088578525?_rdr' #This url is changed to a redirection to login
  
  &gt;&gt;&gt; len(searchable_html.find('article'))
  0
  &gt;&gt;&gt; len(unsearchable_html.find('article'))
  21
  </code></pre>
  
  <p>I'm trying to figure this out in python, I'm not at all familiar with html so it's been tricky. Any help would be greatly appreciated.
  Thankyou.</p>