i am very noob here beginner of python. I use mechanize & beautiful soup to write some code as below:
from mechanize import Browser
from bs4 import BeautifulSoup as BS
br = Browser()
# Browser options
# Ignore robotx.
br.set_handle_robots(False)
br.set_handle_referer(False)
br.set_handle_referer(False)
br.addheaders = [('User-agent', 'Firefox')]
br.open('http://www.amazon.in/')
br.select_form(name='site-search')
br['field-keywords'] = 'Blackberry'
br.submit()
soup = BS(br.response().read())
for product in soup.find_all('h3', class_='newaps'):
print "Product Name:" + product.a.text
print "Product Url:" + product.a["href"]
But in powershell,when i run the code this is the error i got:
To get rid of this warning, change this:
BeautifulSoup([your markup])
to this:
BeautifulSoup([your markup], "html.parser")
Any idea what's happening here??Please help:-)
And i am using Windows