Crawler problem, keep getting the error: " TypeError: 'NoneType' object is not callable"

+1 Mas Airman · February 3, 2016
I know this will turn out to be a stupid simple thing but I began learning Python a week ago, so bear with me here:

import requests
from bs4 import BeautifulSoup

def ishcrw(wtif):
  pages = 1
  while pages <= wtif:
  url = '' + str(pages)
  source = requests.get(url)
  txt = source.text
  soup4 = BeautifulSoup(txt, 'html.parser')
  for ids in soup4.findALL('a', {'class': 'bigusername'}):
      href = '' + ids.get('href')
      title = ids.string
  pages =+ 1


I'm trying to grab the usernames and their corresponding links on a sample thread in that forum.

Post a Reply


Oldest  Newest  Rating
+1 sfolje 0 · February 4, 2016
Second answer:

typo aka typing error aka tiny lil mistake

Take a look :

    findAll vs. findALL

Notice any difference?
You got it.
+1 sfolje 0 · February 5, 2016
no problem, brah
0 Mas Airman · February 3, 2016
Btw, this is an excerpt from the page source:

<div id="postmenu_12094678">

<a class="bigusername" href="member.php?u=10283">Lebron23</a>

<script type="text/javascript"> vbmenu_register("postmenu_12094678", true); </script>

0 Taiwo Kareem · February 4, 2016
You haven't returned anything from the method. That is why. you need return as the last line of your method.
0 Mas Airman · February 5, 2016
@sfolje LMAO thanks man, I knew it was something silly and trivial like that, you saved my life :P
  • 1



This section is all about snakes! Just kidding.

Bucky Roberts Administrator