
from bs4 import BeautifulSoup
import requests
import re

soup = BeautifulSoup(requests.get("http://www.craigslist.org/about/sites").text, "html.parser")


for columnDiv  in soup.h1.next_sibling.next_sibling:
	for state in columnDiv.next_sibling.next_sibling:
		for city in state:
			print(city)
print("\n----Done----\n\n")


from bs4 import BeautifulSoup
import requests
import re

soup = BeautifulSoup(requests.get("http://www.craigslist.org/about/sites").text, "html.parser")

for columnDiv in soup.h1.next_sibling.next_sibling:
	for state in columnDiv:
		for city in state:
			print(city)
print("\n----Done----\n\n")

Fix city scraper, doesn't throw type error
Fix city scraper, doesn't throw type error

City scraper now prints out html for every city and territory in
the us without throwing any error.

  
  from bs4 import BeautifulSoup
  import requests
  import re
  
  soup = BeautifulSoup(requests.get("http://www.craigslist.org/about/sites").text, "html.parser")
  
- 
- for columnDiv  in soup.h1.next_sibling.next_sibling:
+ for columnDiv in soup.h1.next_sibling.next_sibling:
- 	for state in columnDiv.next_sibling.next_sibling:
+ 	for state in columnDiv:
  		for city in state:
  			print(city)
  print("\n----Done----\n\n")
  
Fix city scraper, doesn't throw type error
## Code Before:

from bs4 import BeautifulSoup
import requests
import re

soup = BeautifulSoup(requests.get("http://www.craigslist.org/about/sites").text, "html.parser")


for columnDiv  in soup.h1.next_sibling.next_sibling:
	for state in columnDiv.next_sibling.next_sibling:
		for city in state:
			print(city)
print("\n----Done----\n\n")

## Instruction:
Fix city scraper, doesn't throw type error
## Code After:

from bs4 import BeautifulSoup
import requests
import re

soup = BeautifulSoup(requests.get("http://www.craigslist.org/about/sites").text, "html.parser")

for columnDiv in soup.h1.next_sibling.next_sibling:
	for state in columnDiv:
		for city in state:
			print(city)
print("\n----Done----\n\n")
