Scraping from an existing chrome window with Selenium - screen-scraping

I am trying to find a way to scrape a webpage - actually a Tradingview chart - from a window that has already been opened and logged into manually.
I have a python script that opens a chart, logs in, and scrapes elements using find_element(By.XPATH,'')
The problem with this is that every time it runs, it logs in like a brand new user on a brand new installation of chrome; no cookies or previous user data.
I previously had a chrome app that was able to scrape a chrome page that I had already opened and logged into manually. It would not have to fetch the data and initiate the page. The page was already open. And it just scraped the open page (actually a Tradingview chart) whenever it wanted the data.
It would be akin to scraping a page that was open in a browser but not connected to the internet.
It just scrapes whatever's there and skips the whole download, cookie verification part of the process...because I've already done that manually..
Is there a way to do this with selenium?

Related

How to refresh service worker when new update is pushed on server

I have a react app created by craco, it have service worker registered.
After pushing new build to server, user is still getting old data / build files as they are cached by service worker.
How can i force refresh the webpage, or give popup to user to refresh the page.
I tried using the existing code in onstatechange method which says -
New content is available and will be used when all tabs for this page are closed.
But this message pops up even if i change the state to offline.
Please suggest on how it can be achieved without forcing to close all tabs.

I can access my heroku app live but my friends see only white blank page?

please check my app - https://real-estate-web-app.herokuapp.com
the app is accessible in chrome only I open the app with another browser it shows me a white blank page.
and please share the solution.
I tried all online solutions but no help
I want to share the app with the client and my friends for testing.
I was able to open up the app in both Chrome and Firefox, loading just fine. Only thing I noticed was something odd with the Google Map API's, message about it receiving too many calls to the API. Also I believe by default Heroku has a "sleep" type setting, so the page doesn't stay loaded if the URL hasn't been visited recently; basically it pings the server and tells it to wake back up and then process the request and load the app. This may result in like a 10-15 second load time the first time hitting the page.

Microsoft Teams - downloading a file from within a tab

I've created a configurable tab app and have side-loaded it into Teams. On the content page, I want to allow the user to download a file. Simply linking to the file doesn't work. When the user clicks the link, the content iframe redirects and goes blank. I've tested this in the web app version of Teams at teams.microsoft.com and it works fine. The file gets downloaded as you would expect.
If it makes any difference, the content page is hosted in SharePoint on a modern page using SPFx.

Handle error in AngularJs if iFrame page post throws exception

I have a web application that needs to display dynamically created MS Word files and it has following constituents:
A web service that returns the Word file Stream
An intermediate server page that calls the web service and writes the stream to Response
A web page (built in AngularJs) that collects user inputs and posts data to the intermediate page. Input also contains a file that user uploads from his computer.
From the AngularJs page, I post data to the intermediate page using a hidden iFrame. Entire setup works well and when the user clicks Submit and the browser duly shows Open/Save/Cancel dialog.
How do I display a message if web service throws exception? I am not able to catch it from AngularJs code.
PS: I can use the intermediate page to display the message in iFrame but then I need to clear it out when user takes another action on the form. How can I do that from AngularJs?

Populating data in Silverlight App before its sent to he browser

I have a Silverlight App which gets its data from a database. My Silverlight app (running in the browser) retrieves the data through a web service. Pretty standard setup.
But there is some data which has to be there all the time or the App is in an invalid state - think data to fill drop downs etc. So I need this data to be "pre-loaded" into the App before it's sent down to the client so that it's never in an invalid state. Today I load this data via a web service call when my first page is initialized which can some times take a few seconds - during that time my App is in an invalid state.
Is there a way to populate data (from a backend database) in my Silverlight App before it's sent to the browser?
It is valid for an app to start and not be ready to use for a while, so long as the user cannot interact with it (or see the broken bits:))
Better to ensure your app has a splash screen/login page etc that displays until such time as the required resources are loaded. Once loaded you can set an app state to then show the main screen.
I had the same problem with a website that loaded the menu items via a service (as the text was data driven). Wound up running a progress spinner over the top (with a full-screen background).
I don't think you can. The application runtime occurs on the client's machine. I would suggest putting up a loading dialog while you bring those items down from the database.
What HiTech Magic said. Best practice for this is to use a splash screen or login page. You can also have your buttons (and interaction) disabled by default, and after the data is loaded, enable the UI. I would go with the spash screen though..

Resources