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

created web scraping for amazon website #290

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

Conversation

AneekaMari
Copy link

No description provided.

Copy link

@Alperencode Alperencode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just suggested few things to keep your code clean and more readable. Other things looks just fine.


def get_data(pageNo):

r = requests.get('https://www.amazon.in/gp/bestsellers/dvd/21360334031/ref=zg_bs_pg_?'+str(pageNo)+'ie=UTF8&pg='+str(pageNo))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

soup = BeautifulSoup(content)

alls = []
for d in soup.findAll('div', attrs={'class':'a-section a-spacing-none aok-relative'}):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are just specifiying the class you can use it like this:
soup.findAll('div', class_='a-section a-spacing-none aok-relative')

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