A memorandum of extraction by python bs4 request

It is a memorandum at the time of web scribing with python.

from bs4 import BeautifulSoup
import reuest
import os
"""Proxy support"""
os.environ["https_proxy"] = "http://xxx.xx.xx.xx:8080"
url = "https://www.python.org/"
html = requests.get(url)
soup = BeautifulSoup(html.text, "lxml")
print(soup)
print("----------------------------------------------")
# python.If you want to get only the strings in org
name = soup.find_all("div", class_="introduction")
# name = soup.find_all("div", {"class": "introduction"}May be described as.
name = name[0].text
print(name)
title = soup.find_all("title")
title = title[0].text
print(title)

result

Python is a programming language that lets you work quickly and integrate systems more effectively. Learn More

Welcome to Python.org

Recommended Posts

A memorandum of extraction by python bs4 request
[Python] A memorandum of beautiful soup4
A memorandum of python string deletion process
A memorandum of scraping & machine learning [development technique] by Python (Chapter 4)
A memorandum of scraping & machine learning [development technique] by Python (Chapter 5)
A memorandum of calling Python from Common Lisp
Group by consecutive elements of a list in Python
A memorandum of kernel compilation
A small memorandum of openpyxl
Keyword extraction by MeCab (python)
A memorandum about correlation [Python]
A memorandum about Python mock
A memorandum of using eigen3
A memorandum of stumbling on my personal HEROKU & Python (Flask)
[Python] How to make a list of character strings character by character
A record of patching a python package
A good description of Python decorators
Expansion by argument of python dictionary
A brief summary of Python collections
A memorandum of files under conf.d
10 selections of data extraction by pandas.DataFrame.query
Behavior of python3 by Sakura's server
Memorandum of beginners Python "isdigit" movement
A memorandum of closure survey contents
Story of power approximation by Python
A memorandum of understanding for the Python package management tool ez_setup
[Python] A memo of frequently used phrases (by myself) in Python scripts
A simple data analysis of Bitcoin provided by CoinMetrics in Python
Read the standard output of a subprocess line by line in Python
Impressions of touching Dash, a data visualization tool made by python
A memorandum regarding the acquisition of the Python3 engineer certification basic exam
Explanation of production optimization model by Python
Python memorandum
[Learning memo] Basics of class by python
Python Memorandum 2
A memorandum of using Python's input function
Extraction of tweet.js (json.loads and eval) (Python)
Conditional branching of Python learned by chemoinformatics
A memorandum of speed of arbitrary degree diagonalization
Make a relation diagram of Python module
Memorandum of python beginners About inclusion notation
A memorandum of understanding about django's QueryDict
Grayscale by matrix-Reinventor of Python image processing-
Example of 3D skeleton analysis by Python
Python memorandum
[python] Get a list of instance variables
[python] [meta] Is the type of python a type?
python memorandum
Pandas of the beginner, by the beginner, for the beginner [Python]
python memorandum
Analysis of X-ray microtomography image by Python
The story of blackjack A processing (python)
Python memorandum
python memorandum
[Python] Get a list of folders only
Python memorandum
A textbook for beginners made by Python beginners
A memorandum of trouble when formatting data
A story made by a person who has no knowledge of Python or Json
Get a list of articles posted by users with Python 3 Qiita API v2
[python] How to sort by the Nth Mth element of a multidimensional array