Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the NIPS crawler to work with the new format on the website #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gwenniger
Copy link

with the changed format of the newlines.

TODO: It seems like still further fixes to get/parse the reviews may be
necessary.

modified:   code/data_prepare/crawler/NIPS_crawl.py

with the changed format of the newlines.

TODO: It seems like still further fixes to get/parse the reviews may be
necessary.

	modified:   code/data_prepare/crawler/NIPS_crawl.py
@emaadmanzoor
Copy link

emaadmanzoor commented Jan 31, 2020

The NeurIPS crawler doesn't work on my end either (Python 2), the parsing logic (specifically, matching on <p>(.*)</p>) is incorrect. I was able to fix it by replacing that portion of the scraper with the following (uses BeautifulSoup4):

data = str(get_url(http, reviews_url))
...
soup = BeautifulSoup(data, 'html.parser')
...
if year < 2016:
...
else:
        review_divs = [div.text for div in
                       soup.find_all("div", style="white-space: pre-wrap;")]
        for review_div in review_divs:
            r = Review(None, review_div, None, None, None, None, None, None)
            reviews.append(r)
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants