Skip to content

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