Comparison with GP Election Data
This page is a comparison of the data on GP.org/2020-candidates
COULD NOT DISPLAY THAT PAGE.
HERE IS THE ERROR MESSAGE:
'RootPage' object has no attribute 'politicians' - Expression: " from bs4 import BeautifulSoup from slugify import slugify data = context['data'].source soup = BeautifulSoup(data, 'html.parser') records = soup.find_all('tr') root = view.getSiteRoot() politicians = root.politicians results = [] for row in records: cells = row.find_all('td') theRow = [] for td in cells: theRow.append (td.text) results.append(theRow) results = results[2:] theirs = {} for item in results: theirs[slugify(item[1])] = item needed = [] for item in results: slug = slugify (item[1]) if slug in politicians: continue needed.append(item) gpNeeds =[] for key, value in politicians.items(): if not key in theirs" - Filename: comparison-with-gp-election-data/content - Location: (line 1: col 10) - Arguments: context:
request:
view:
target_language:
repeat:
data:
records:
root:
'RootPage' object has no attribute 'politicians' - Expression: " from bs4 import BeautifulSoup from slugify import slugify data = context['data'].source soup = BeautifulSoup(data, 'html.parser') records = soup.find_all('tr') root = view.getSiteRoot() politicians = root.politicians results = [] for row in records: cells = row.find_all('td') theRow = [] for td in cells: theRow.append (td.text) results.append(theRow) results = results[2:] theirs = {} for item in results: theirs[slugify(item[1])] = item needed = [] for item in results: slug = slugify (item[1]) if slug in politicians: continue needed.append(item) gpNeeds =[] for key, value in politicians.items(): if not key in theirs" - Filename: comparison-with-gp-election-data/content - Location: (line 1: col 10) - Arguments: context: