简体   繁体   中英

trying to find a way to “listen” to events on an external web page

Im trying to find a way to listen to changes that accoure on a random page, for example lets say im trying to listen on a stock price located in a website that dosnt have an api for pulling that data. Currently what im doing is reading the page each couple of seconds and parse that specific element with jquery, which is hacki's in my opinion. Is there away to listen to the event that changes the stock price? or anything better?

You can use https://socket.io/ .

So if any changes done in page, you can emit & listen it on another page, so you will know that change has been made.

Ex. Suppose you are in page1 & you made some changes & that changes you want to get in page 2. Then from page 1 emit it & in page 2 you can listen it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM