I am following this tutorial: Pandas Tutorials : Web Scraping - YouTube
I am having trouble with this code:
Please assist.
I am following this tutorial: Pandas Tutorials : Web Scraping - YouTube
I am having trouble with this code:
Please assist.
âUnexpected indentâ means exactly what it says. Remove the indent (leading spaces or tabs) from the beginning of the line.
Also, please donât post photos or screenshots of code unless you use Photoshop to edit it
In this case it doesnât make much difference, but screenshots make it difficult for us to run your code if we have to, and discriminate against the blind and visually impaired (yes, blind programmers exist).
Instead, copy the relevant code and error message, and paste it into the Discuss text entry widget. Use the </>
button to format it as code, by placing the copied code between âcode fencesâ, three backticks on a line of their own before and after the code:
```
paste your code here
```
âreview_text_elem = soup.find_all(class_= âellipsis_textâ)
review_text_elemâ
NameError: name âsoupâ is not defined
Again, the message says it all: you havenât defined soup
. You have defined Data
however, from the context it appears that you want to use that
I start with this:
import request
import pandas as pd
from bs4 BeautifulSoup
#send request
url=âReviews of Credit Cards, Loans, Insurance |BankBazaarâ
page=requests.get(url)
page.text
url = 'https://www.bankbazaar.com/reviews.html'
page=requests.get(url)
Soup = BeautifulSoup(page.text, 'html.parser')
review_text_elem = soup.find_all(class_= 'ellipsis_text')
review_text_elem
soup is not Soup. Python is case-sensitive.
Use the </> button to paste TEXT do not put picture of code in here please.
All of the code has already been supplied. I include pics for the outcome i get.
Weâd like text for those also. The visually impaired have trouble with
pictures. We cannot copy/paste text from pictures, particularly if we
want to quote specific bits back at you for context. People on email do
not receive the pictures, and must tediously trudge to the forum to look
at them.
Thank you,
Cameron Simpson cs@cskk.id.au
Am I correct in noticing that the code where you say âI am getting this outputâ is different from the code where you say âI am supposed to get a similar output like thisâ ?
Hi Albert
If you can please try this tutorial(I shared the link)on your side and show me what you have come up with.