Python-下载JQueryFileTree中包含的PDF

我正在创建一个下载的文件,以便从与雇主公司相关的网站上自动下载PDF。

看起来PDF包含在JQueryFileTree中。有什么方法可以下载下面的一个文件夹,并将其连同PDF的内容一起保存到磁盘上?

到目前为止,我正在使用Python和Selenium来自动执行登录等操作。

谢谢

到目前为止,我的代码:

from selenium import webdriver
from time import sleep 
import requests
from bs4 import BeautifulSoup as bs 

import secrets

class manual_grabber():
    """ A class creating a manual downloader for the Roger Technology website """
    def __init__(self):
        """ Initialize attributes of manual grabber """
        self.driver = webdriver.Chrome('\\Users\\Joel\\Desktop\\Python\\manual_grabber\\chromedriver.exe')

    def login(self):
        """ Function controlling the login logic """
        self.driver.get('urltosite')

        sleep(1)

        # Locate elements and enter login details
        user_in = self.driver.find_element_by_xpath('/html/body/div[2]/form/input[6]')
        user_in.send_keys(secrets.username)   

        pass_in = self.driver.find_element_by_xpath('/html/body/div[2]/form/input[7]')
        pass_in.send_keys(secrets.password)

        enter_button = self.driver.find_element_by_xpath('/html/body/div[2]/form/div/input')
        enter_button.click()
        
        # Click Self Service Area button
        self_service_button = self.driver.find_element_by_xpath('//*[@id="bs-example-navbar-collapse-1"]/ul/li[1]/a')
        self_service_button.click()


grab = manual_grabber()
grab.login()

文件结构是这样的:

单击这些文件夹之一时,它将在树的右侧窗口中打开PDF内容。

和DOM:

enter image description here

相关文章

np.linspace函数的基本语法如下:numpy.linspace(start,&nbs...
Python中的函数(二) 在上一篇文章中提到了Python中函数的定...
Python中的字符串 可能大多数人在学习C语言的时候,最先接触...
Python 面向对象编程(一) 虽然Python是解释性语言,但是它...
Python面向对象编程(二) 在前面一篇文章中谈到了类的基本定...
Python中的函数(一) 接触过C语言的朋友对函数这个词肯定非...