GithubHelp home page GithubHelp logo

Comments (3)

adbar avatar adbar commented on August 31, 2024

Hi @kondounagi, could you please be more specific? Please bear in mind however that the library is not geared towards browser automation.

from trafilatura.

kondounagi avatar kondounagi commented on August 31, 2024

Hi @adbar , thank you for your excellent tool!
trafilatura.fetch_url and other helper functions in this library help gather texts from the web; however, we cannot apply them to websites with basic authentication, which require a username and password.
For example, when I gather docs from a basic-authed website, I must use the requests library to pass basic auth like below.

class BasicAuth:
    def __init__(self, username: str, password: str):
        self.session = requests.Session()
        self.session.auth = username, password

    def __call__(self, _url):
        return self.session.get(_url)

I hope we can specify our id and password of basic auth in fetch_url and other helper functions!

from trafilatura.

adbar avatar adbar commented on August 31, 2024

I understand, thanks for the details. The issue seems related to #322 and could be addressed by providing a more configurable function to fetch HTML documents. Let's keep the issue open for now.

from trafilatura.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.