edsu / etudier

Extract a citation network from Google Scholar
161 stars 27 forks source link

UnboundLocalError: local variable 'source' referenced before assignment #2

Closed shawngraham closed 6 years ago

shawngraham commented 6 years ago

this: etudier.py 'https://scholar.google.com/scholar?oi=bibs&hl=en&authuser=1&cites=14537868009939739864&as_sdt=5'

worked fine; this:

etudier.py --pages 2 'https://scholar.google.com/scholar?oi=bibs&hl=en&authuser=1&cites=14537868009939739864&as_sdt=5'

produced this error:

Towards the computational study of the Roman economy: draft -> Travellersim: growing settlement structures and territories with agent-based modelling
https://scholar.google.com/scholar?start=10&hl=en&as_sdt=2005&sciodt=2005&cites=14099855905029022891&scipsc=
Traceback (most recent call last):
  File "/usr/local/bin/etudier.py", line 266, in <module>
    main(args.url, output=args.output, depth=args.depth, pages=args.pages)
  File "/usr/local/bin/etudier.py", line 20, in main
    for from_pub, to_pub in get_citations(url, depth=depth, pages=pages):
  File "/usr/local/bin/etudier.py", line 91, in get_citations
    pages=pages
  File "/usr/local/bin/etudier.py", line 100, in get_citations
    pages=pages-1
  File "/usr/local/bin/etudier.py", line 63, in get_citations
    if ',' in source:
UnboundLocalError: local variable 'source' referenced before assignment
edsu commented 6 years ago

This was fixed in #1. I just ran it with no problem.