Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webi_preview doesn't accept headers #12

Open
wx2228 opened this issue Mar 3, 2018 · 1 comment
Open

webi_preview doesn't accept headers #12

wx2228 opened this issue Mar 3, 2018 · 1 comment

Comments

@wx2228
Copy link

wx2228 commented Mar 3, 2018

Thanks for building this awesome pkg. In the readMe you claim it supports passing headers to web_preview function, but it doesn't.

Update: I just found out the header feature is supported in 1.3.1, but only for python3, is th7?ere any plan to support this in python2.7?

@vduseev
Copy link
Collaborator

vduseev commented Aug 12, 2022

Hi @wx2228! Don't we all love replies that come 4 years after the original question was asked 😄?

Nevertheless, headers can be passed directly to the webpreview function as one of the keyword arguments. They are then passed as-is to requests call.

def webpreview(
url: str,
timeout: Optional[str] = None,
headers: Optional[Dict[str, str]] = None,
content: Optional[str] = None,
target_attribute: Optional[str] = None,
properties: Optional[List[str]] = None,
parser: str = "html.parser",
absolute_url: bool = False,
) -> WebPreview:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants