Exemplo n.º 1
0
    def get_iframe(self):
        self.has_iframe, self.el_iframe = self.get_el(self.xpath_pdf)
        if self.has_iframe:
            self.pdf_url = norm_url(self.el_iframe.get_attribute("src"))
        else:
            self.driver.save_screenshot(self.pdf_file + ".png")

        return self.has_iframe
Exemplo n.º 2
0
    def get_pdf_url(self):
        html_a = self.html_tree.xpath(self.xpath_pdf_url)
        if len(html_a) == 0:
            print("\tPDF link for ", self.page_url, " not found")
            found = False
            self.pdf_url = None
        else:
            self.pdf_url = norm_url(html_a[0].attrib["href"])
            found = True

        return found, self.pdf_url