Assignment
All questions must be answered only with Python programs. Question 1 (Download Apple Products from Amazon.com) (60 marks)
This exercise explores the Python Selenium and the regular expressions to download the Apple products offered by amazon.com.
The 58 webpages offered Apple products (some of the products may just be Apple products related) by Amazon.com.
%3AApple&page=1
driver = webdriver.Chrome(location of your chromedriver.exe)
Display_Size 4 inches
Display_Type Retina
Manufacturer Apple
More_Offer $89.75(31 used & new offers)
Number_of_Review 1924
Offer_Price $90.00
Product_detail Apple iPhone 5c Unlocked Cellphone, 16GB, White
Special Feature dual-camera
Special_Offer NaN
Rating [3.6 out of 5 stars]
Use one of the following Selenium commands to obtain the product information:
driver.find_element_by_class_name(name) Elements that use the CSS class name
driver.find_element_by_css_selector(selector) Elements that match the CSS selector
driver.find_element_by_id(id)
Elements with a matching id attribute value
driver.find_element_by_link_text(text)
<a> elements that completely match the text provided
driver.find_element_by_partial_link_text(text)
<a> elements that contain the text provided
driver.find_element_by_name(name) Elements with a matching name attribute value
driver.find_element_by_tag_name(name)
Elements with a matching tag name (case insensitive; an <a> element is matched by ‘a’ and ‘A’)