Telegram Group & Telegram Channel
🔥 Полезные библиотеки Python

Requests-HTML
— максимально простая и интуитивно понятная библиотека для парсинга html включая асинхронный парсинг.

Установка:
$ pip install requests-html

Пример использования:

1️⃣
from requests_html import HTMLSession
session = HTMLSession()
r = session.get('https://python.org/')


2️⃣
from requests_html import AsyncHTMLSession
asession = AsyncHTMLSession()
async def get_pythonorg():
r = await asession.get('https://python.org/')
return r

async def get_reddit():
r = await asession.get('https://reddit.com/')
return r

async def get_google():
r = await asession.get('https://google.com/')
return r

results = asession.run(get_pythonorg, get_reddit, get_google)
results # check the requests all returned a 200 (success) code
[<Response [200]>, <Response [200]>, <Response [200]>]

for result in results:
print(result.html.url)


Из коробки поддерживает сохранение cookie файлов, имитирует user-agent, асинхронные запросы, JavaScript и д.р. плюшки.

⚙️ GitHub/Инструкция

#python #github #soft
Please open Telegram to view this post
VIEW IN TELEGRAM



tg-me.com/githubdevs/501
Create:
Last Update:

🔥 Полезные библиотеки Python

Requests-HTML
— максимально простая и интуитивно понятная библиотека для парсинга html включая асинхронный парсинг.

Установка:
$ pip install requests-html

Пример использования:

1️⃣

from requests_html import HTMLSession
session = HTMLSession()
r = session.get('https://python.org/')


2️⃣
from requests_html import AsyncHTMLSession
asession = AsyncHTMLSession()
async def get_pythonorg():
r = await asession.get('https://python.org/')
return r

async def get_reddit():
r = await asession.get('https://reddit.com/')
return r

async def get_google():
r = await asession.get('https://google.com/')
return r

results = asession.run(get_pythonorg, get_reddit, get_google)
results # check the requests all returned a 200 (success) code
[<Response [200]>, <Response [200]>, <Response [200]>]

for result in results:
print(result.html.url)


Из коробки поддерживает сохранение cookie файлов, имитирует user-agent, асинхронные запросы, JavaScript и д.р. плюшки.

⚙️ GitHub/Инструкция

#python #github #soft

BY GitHub программиста




Share with your friend now:
tg-me.com/githubdevs/501

View MORE
Open in Telegram


GitHub программиста Telegram | DID YOU KNOW?

Date: |

The STAR Market, as is implied by the name, is heavily geared toward smaller innovative tech companies, in particular those engaged in strategically important fields, such as biopharmaceuticals, 5G technology, semiconductors, and new energy. The STAR Market currently has 340 listed securities. The STAR Market is seen as important for China’s high-tech and emerging industries, providing a space for smaller companies to raise capital in China. This is especially significant for technology companies that may be viewed with suspicion on overseas stock exchanges.

Mr. Durov launched Telegram in late 2013 with his brother, Nikolai, just months before he was pushed out of VK, the Russian social-media platform he founded. Mr. Durov pitched his new app—funded with the proceeds from the VK sale—less as a business than as a way for people to send messages while avoiding government surveillance and censorship.

GitHub программиста from us


Telegram GitHub программиста
FROM USA