Running Streamlit with selenium on a virtual machine

Hi,

I created a streamlit app with a webscraper function realized with selenium.

When I run the code on my local machine everything works well.

  • Microsoft edge is opened
  • data is read
  • data can be processed

When I run the exactly same code on the virtual machine and stream the app it does not work.
Microsoft Edge is opened and it is shown that the browser is externally controlled but it seems that no data is read.

I get the following error messages:

DevTools listening on ws://127.0.0.1:65043/devtools/browser/dbdcd129-9727-4dfb-8101-a772e22fc803
[4940:6520:0503/120053.975:ERROR:edge_auth_errors.cc(408)] EDGE_IDENTITY: Get Default OS Account failed: Error: Primary Error: kTokenRequestFailed, Secondary Error: kTokenFetchUserInteractionRequired, Platform error: -895352820, hex:caa2000c, Error string: Error code: 0xcaa2000c, error message:AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access ‘d32c68ad-72d2-4acb-a0c7-46bb2cf93873’.
Trace ID: b5a47133-1db9-4ace-8f34-65f4e4083400
Correlation ID: bff6cc14-4e18-4107-938a-834af37c2f65

[4940:6520:0503/120054.355:ERROR:fallback_task_provider.cc(124)] Every renderer should have at least one task provided by a primary task provider. If a “Renderer” fallback task is shown, it is a bug. If you have repro steps, please file a new bug and tag it as a dependency of 739782 - chromium - An open-source project to help move the web forward. - Monorail.

C:\Scripts \xx.py:224: DeprecationWarning: find_elements_by_xpath is deprecated. Please use find_elements(by=By.XPATH, value=xpath) instead
values = driver.find_elements_by_xpath(’//td[@class=“ms-formbody”]’)

Does anybody have an idea how this problem can solved?

Thanks

I would guess this is the issue. Are you accessing a secured piece of content? If so, your local laptop might have the security done correctly (i.e. whatever you use to access a VPN), but the VM does not have the same configuration settings present.

Best,
Randy

Hi Randy,

thanks for the quick reply. I found another error in my script where I tried to access a wrong variable what had nothing to do with the access.
Although I get the accessing errors everything is running now.

Thanks
Kai

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.