Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

selenium get response body python

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from webdriver_manager.chrome import ChromeDriverManager #This lets users download latest version of chrome driver automatically
from bs4 import BeautifulSoup

chrome_options = Options()
chrome_options.add_argument("no-sandbox")
chrome_options.add_argument("--disable-extensions")
chrome_options.add_argument("--headless")

driver = webdriver.Chrome(ChromeDriverManager().install(),options=chrome_options) #auto download or use cache of chrome driver
url = 'https://google.com'
driver.get(url)

html = driver.page_source
soup = BeautifulSoup(html, features='lxml')

print(soup)
Comment

PREVIOUS NEXT
Code Example
Python :: if in one line python 
Python :: python terminal ui 
Python :: pandas include nan in value_counts 
Python :: get variable from function python 
Python :: Insert between Characters Python 
Python :: int to float python 
Python :: python - How to subtract values from dictionaries 
Python :: python colored text in console 
Python :: music distorted on discord 
Python :: python telegram bot async 
Python :: @foreach 1 numper 
Python :: tuple push 
Python :: python np.sum 
Python :: pandas merge sort columns 
Python :: generate barcode using python 
Python :: plt.semilogx 
Python :: lru_cache 
Python :: python list pop 
Python :: id3 algorithm code in python 
Python :: string + string in python 
Python :: random seed python 
Python :: plt.scatter background color 
Python :: create array numpy 
Python :: return array of sorted objects 
Python :: python if file exists append else create 
Python :: how to delete a column in pandas dataframe 
Python :: replace all occurrences of a value to nan in pandas 
Python :: add columns not in place 
Python :: append and extend in python 
Python :: database with python connection 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =