0

Is it possible to pass BeautifulSoup a HTML I have copied in my clipboard using pyperclip. I have difficulties using requests as the page requires login, and the usual methods for passing cookies to requests doesn't work.

1 Answers1

0

The first approach using Pyperclip would be:

soup = BeautifulSoup(pyperclip.paste(), "html.parser")

You could also save the html file locally with Ctrl+S and import the html file in Python:

with open(r'yourfile.html', "r", encoding='utf-8') as html_file:
    soup = BeautifulSoup(html_file.read(), "html.parser")