Relative Content

Tag Archive for pythonwebsocket

My function does not close the WebSocket connection

I have a websocket client which connects to a real time data stream. The connection works fine and when I run hello it connects to the stream. Since the WebSocket server runs and sends permanently there is to much data in a really short time and I want to close the connection manually. I wrote the function close_connection but nothing happens when I call it and I do not know why.

Connect to websocket from request

I want to connect to a websocket to process real time data. The URL look like this: https://testsite.test.de/Interfaces. When I enter it in Firefox it asks immediately for username and password. After I enter them the status codes are 200 with HTTP/1.1, 200 HTTP/2, 101 switching protocols connection upgrade and the Scheme changes to wws://.

How to scrape real time data stream from website?

I have an URL with requiered login, where after entering the credentials the message “connected with websocket” appears and a realtime data stream starts showing up. I want to scrape this data stream with Python to further process it. What I do not understand is which set of tools I need. Is this something to to with a websocket client or with a webscraper like beautiful soup or completely different tool?