Code Monkey home page Code Monkey logo

p8mawpup-gabrielapersaud's Introduction

Note: I didn't get the cvs, after I activated the virtual environment I wrote all this code in the command prompt to do this just write:

python

after activating virtual environment.

Note: I'm using python 2.7.14

ok, let's get to business!

  1. go to your cmd, and type in: easy_install pip
    pip install BeautifulSoup4

Be sure to activate virtual environment.

2.) In notepad++ make sure you're in python mode and write the code below:

importing libraries

import urllib2 <--------- (start here)

from bs4 import BeautifulSoup

quote_page = 'https://www.amazon.com/Jimmy-Paddox-Leather-Black-Biker/dp/B0771TB2Y1/ref=sr_1_9?s=apparel&ie=UTF8&qid=1511230028&sr=1-9&nodeID=7141123011&psd=1' <----- click the link, and get the link from the official website. DO NOT USE THIS ONE EVEN THOUGH IT'S THE SAME,or you'll get an error in your cmd.

page = urllib2.urlopen(quote_page)

soup = BeautifulSoup(page, 'html.parser')

title_box = soup.find('h1', attrs={'id': 'title'})

title = title_box.text.strip()

print title

priceblock_ourprice_box = soup.find('span', attrs={'id':'priceblock_ourprice'})

priceblock_ourprice = priceblock_ourprice_box.text

print priceblock_ourprice

p8mawpup-gabrielapersaud's People

Contributors

gabrielapersaud avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.