Answer the question
In order to leave comments, you need to log in
Is it possible to call a page's html script from a variable in Python?
Opening a local html page with a browser driver is not a problem. And how to write the page into a variable so as not to produce files?
Is it clear now:
from selenium import webdriver
options = webdriver.ChromeOptions()
browser = webdriver.Chrome(options=options)
browser.get('file:///C:/page.html')
from selenium import webdriver
page = '''...html_скрипт...'''
options = webdriver.ChromeOptions()
browser = webdriver.Chrome(options=options)
browser.get(page)
File "C:\ProgramData\Anaconda3\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
InvalidArgumentException: invalid argument
(Session info: chrome= 83.0.4103.97)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question