Я пытаюсь загрузить проблемы журнала с веб-сайта (http://cis -ca.org / islamscience1.php ). Я запустил что-то, чтобы получить все PDF-файлы на этой странице. Однако внутри этих PDF-файлов есть ссылки, которые ссылаются на другой PDF-файл.
Я хочу получать статьи о терминалах из всех ссылок PDF.
Получил все PDF-файлы со страницы: http://cis -ca.org / islamscience1.php
import os
import requests
from urllib.parse import urljoin
from bs4 import BeautifulSoup
url = "http://cis-ca.org/islamscience1.php"
#If there is no such folder, the script will create one automatically
folder_location = r'webscraping'
if not os.path.exists(folder_location):os.mkdir(folder_location)
response = requests.get(url)
soup= BeautifulSoup(response.text, "html.parser")
for link in soup.select("a[href$='.pdf']"):
#Name the pdf files using the last portion of each link which are unique in this case
filename = os.path.join(folder_location,link['href'].split('/')[-1])
with open(filename, 'wb') as f:
f.write(requests.get(urljoin(url,link['href'])).content)
Я бы хотел получить ссылки на статьи внутри этих PDF-файлов.
Заранее спасибо