Python
- 1 ответ
- 0 вопросов
0
Вклад в тег
# -*- coding: utf-8 -*-
import pandas as pd
import requests
from bs4 import BeautifulSoup
filename = 'ids.xlsx'
df = pd.read_excel(filename)
url = df.iloc[:, 0].tolist() # Преобразую нулевую колонку к списку
for urlibs in url:
response = requests.get(urlibs)
soup = BeautifulSoup(response.text, 'lxml')
appname = soup.find('h1', class_='AHFaub').text
print(appname)
# -*- coding: utf-8 -*-
import pandas as pd
import requests
from bs4 import BeautifulSoup
from concurrent.futures import ThreadPoolExecutor
filename = 'ids.xlsx'
df = pd.read_excel(filename)
urls = df.iloc[:, 0].tolist()
def get_app_name(url):
response = requests.get(url)
soup = BeautifulSoup(response.text, 'lxml')
appname = soup.find('h1', class_='AHFaub').text
print(appname)
# Число воркеров можно изменить на свое усмотрение
with ThreadPoolExecutor(max_workers=16) as executor:
executor.map(get_app_name, urls)