---
title: "Web Scraping in Python"  
description: "Web Scraping in Python"  
author: "Anonymous User"  
published: 2018-07-13  
updated: 2018-07-13  
canonical: https://www.mindstick.com/forum/34613/web-scraping-in-python  
category: "python"  
tags: ["python-3.4", "python"]  
reading_time: 1 minute  

---

# Web Scraping in Python

How to Implement [web Scraping](https://www.mindstick.com/articles/167575/web-scraping-with-scrapy-advanced-examples) in [Python](https://www.mindstick.com/articles/75378/simple-yet-useful-tips-when-using-python) with BeautifulSoup ?

## Replies

### Reply by Prakash nidhi Verma

Implementing [Web](https://www.mindstick.com/articles/12783/the-ultimate-bunch-of-free-web-design-resources) Scraping in Python with BeautifulSoup:

Use the API of the website. example: Facebook has the Facebook Graph API which

- allows retrieval of data posted on Facebook.

- HTML of the webpage information/data will access.

Installing the required third-party libraries :

```
pip install requests pip install html5lib
pip install bs4
```

Accessing the HTML content from webpage :

```
import requests URL = "https://mindstick.com/forum/"
r = requests.get(URL)
print(r.content)
```

\

Parsing the HTML content :

```
#This will not run on online IDE import requests
from bs4 import BeautifulSoup
URL = "http://www.values.com/inspirational-quotes"
r = requests.get(URL)
soup = BeautifulSoup(r.content, 'html5lib')
print(soup.prettify())
```

```
soup = BeautifulSoup(r.content, 'html5lib') 
```

```
table = soup.find('div', attrs = {'id':'container'}) 
```

```
quote['theme'] = row.h5.text 
```

```
quote['url'] = row.a['href'] 
```


---

Original Source: https://www.mindstick.com/forum/34613/web-scraping-in-python

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
