Giter Site home page Giter Site logo

Newbie about nlp-with-python HOT 6 OPEN

susanli2016 avatar susanli2016 commented on June 17, 2024
Newbie

from nlp-with-python.

Comments (6)

keithweberrit avatar keithweberrit commented on June 17, 2024 3

LOL, this is a moving target. Try replacing the suspect line as follows:

# num_reviews = soup.find('span', class_='reviews_header_count').text # get text    
numSpan = soup.select('span[class*="hotels-hotel-review-community-content-TabBar__tabCount--"]')
num_reviews = numSpan[0].text # get text

from nlp-with-python.

focaalvarez avatar focaalvarez commented on June 17, 2024

Hello Susanli.

I am getting the same error message. I have already checked that bs4 module is installed in my system.

Are we missing something here?

Thank you very much!

from nlp-with-python.

kyle10n avatar kyle10n commented on June 17, 2024

replace line 65 with

num_reviews = soup.find('span', class_='hotels-hotel-review-community-content-TabBar__tabCount--37DbH').text # get text

note the class is changed to something else. I believe when she wrote it TA changed their website.

It was throwing a non type because you created a variable with Nothing inside then you tried using this nothing variable.

from nlp-with-python.

silviasanasi avatar silviasanasi commented on June 17, 2024

I had the same issue and I solved it by inspecting my target page's code.
Probably the errors you get are requiring you to review the source code, which has changed.

from nlp-with-python.

shivaksh21 avatar shivaksh21 commented on June 17, 2024

LOL, this is a moving target. Try replacing the suspect line as follows:

# num_reviews = soup.find('span', class_='reviews_header_count').text # get text    
numSpan = soup.select('span[class*="hotels-hotel-review-community-content-TabBar__tabCount--"]')
num_reviews = numSpan[0].text # get text

Last line is giving error again. List index out of range

from nlp-with-python.

rkmishracs avatar rkmishracs commented on June 17, 2024

I am getting this error while running the code on jupytor notebook.

TypeError Traceback (most recent call last)
in ()
7 for url in start_urls:
8 # get all reviews for 'url' and 'lang'
----> 9 items = scrape(start_urls, lang)
10 if not items:
11 print('No reviews')

in scrape(url, lang)
8 })
9
---> 10 items = parse(session, url+'?filterLang='+lang)
11 return items

TypeError: can only concatenate list (not "str") to list

from nlp-with-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.