Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python requests get title

#!/bin/python
import requests
from bs4 import BeautifulSoup

response = requests.get("https://www.example.com")

if repsonse.status_code == 200:
	soup = BeautifulSoup(response.content, "html.parser")

	# will only find the first match, presumably the page title
	title = soup.find("title").get_text()
Comment

PREVIOUS NEXT
Code Example
Python :: axis font size matplotlib 
Python :: check if a list contains an item from another list python 
Python :: conda python 3.8 
Python :: dictionary with numbers python 
Python :: return maximum of three values in python 
Python :: install models python 
Python :: how to get random word from text file in python 
Python :: pytest skip 
Python :: discord.py mute 
Python :: python ftp upload file 
Python :: renomear colunas pandas 
Python :: how to minimize tkinter window 
Python :: python sqrt import 
Python :: python get ip from hostname 
Python :: no python 3.10 installation was detected 
Python :: python runtime 
Python :: grid in pygame 
Python :: pandas convert to 2 digits decimal 
Python :: pandas rename column 
Python :: pandas drop zero values 
Python :: install aws sdk ubuntu 20.04 command line 
Python :: exponentiation is the raising of one number to the power of another. this operation is performed using two asterisks **. 
Python :: get current time in python with strftime 
Python :: when did guido van rossum create python 
Python :: python deep copy of a dictionary 
Python :: python check operating system 
Python :: Show the records that have nan values 
Python :: matplotlib legend out of plot 
Python :: how to generate requirements.txt django 
Python :: how to make a text input box python pygame 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =