In this case, the user agent string is trying to trick the site into believing that it has been opened up from a browser.JamX wrote: ↑July 24th, 2020, 8:21 pm it seems the regexp error has nothing to do with the "white" values
Capture3.JPG
Now, at 20:03, I had an error and the values are till now OK, but I made some changes...
I've taken a look at the original code from the Author Mordasius where het states:
So I added my useragent: MyUserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36 Edg/84.0.522.40
and added it into the code like:I also changes #UpdateQuotes# to 60 in stead of 15Code: Select all
[InfoIndex1] Measure=WebParser URL=https://www.cnbc.com/quotes/#Symbol1# UserAgent=#MyUserAgent# RegExp=#ExpQuote# StringIndex=1 UpdateRate=#UpdateQuotes# FinishAction=[!Log "Quote Update Finished"]
Question:
What does the useragent actually do?
Before I had NO agent and sometimes the values turned white but most of the time (>95%) values were displayed OK
Now I have an agent and til now (knok on wood) the values are displayed OK
It is currently April 19th, 2024, 1:48 pm
Little help
-
- Rainmeter Sage
- Posts: 7125
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Little help
-
- Posts: 207
- Joined: October 4th, 2019, 2:46 pm
Re: Little help
So, I. General you could say that I do not need a user agent because I alway get the values from the site dispite sometimes assigning the wrong color to it (White)
Maybe increasing the Update rate solved the issue. Till last evening no White values shown
Maybe increasing the Update rate solved the issue. Till last evening no White values shown
-
- Rainmeter Sage
- Posts: 7125
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Little help
Yes, indeed. If the user agent was the problem, you wouldn't have been able to extract the data from the site in the first place.
-
- Posts: 2
- Joined: January 19th, 2021, 1:04 am
Re: Little help
Hi!
Few days ago it seems CNCB changed their website and i now get a RegExp matching error(-1).
Can anyone help with matching the new regexp?
Few days ago it seems CNCB changed their website and i now get a RegExp matching error(-1).
Can anyone help with matching the new regexp?
-
- Posts: 207
- Joined: October 4th, 2019, 2:46 pm
Re: Little help
change the ExpQuote variable with following code
Code: Select all
;ExpQuote=(?siU).*div id="structured-data".*"name" content="(.*)" />.*"price" content="(\d+\.\d{0,2}+).*"PriceChange" content="(.*)" .*"PriceChangePercent" content="(.*)"
ExpQuote=(?siU).*"name":"(.*)".*"price":"(\d+\.\d{0,2}+).*"PriceChange":"(.*)".*"PriceChangePercent":"(.*)"
-
- Posts: 3
- Joined: January 19th, 2021, 4:44 pm
Re: Little help
Thanks, JamX, for the ExpQuote code update!
For me, it works fine with the exception of stocks with share prices over $1K (e.g. AMNZ and GOOG) but maybe that's a result of other things going on in my portfolio code. This was a huge help in getting me back on track. Thanks again!
For me, it works fine with the exception of stocks with share prices over $1K (e.g. AMNZ and GOOG) but maybe that's a result of other things going on in my portfolio code. This was a huge help in getting me back on track. Thanks again!
-
- Posts: 207
- Joined: October 4th, 2019, 2:46 pm
Re: Little help
try this:
Code: Select all
ExpQuote=(?siU).*"name":"(.*)".*"price":"(.*)".*"PriceChange":"(.*)".*"PriceChangePercent":"(.*)"
-
- Posts: 3
- Joined: January 19th, 2021, 4:44 pm
Re: Little help
Thanks so much for the fast response!
This gets things closer. I no longer see a zero for price, but now it seems that for share prices over 1K, I'm seeing the first digit. E.g for AMZN, instead of seeing 3124, I'm seeing 3. But I will investigate more to see if this could reflect some other issue in my code.
Thanks again!
This gets things closer. I no longer see a zero for price, but now it seems that for share prices over 1K, I'm seeing the first digit. E.g for AMZN, instead of seeing 3124, I'm seeing 3. But I will investigate more to see if this could reflect some other issue in my code.
Thanks again!
-
- Posts: 207
- Joined: October 4th, 2019, 2:46 pm
Re: Little help
If I use this:
it's working
Code: Select all
(?siU).*"name":"(.*)".*"price":"(.*)".*"PriceChange":"(.*)".*"PriceChangePercent":"(.*)"
You do not have the required permissions to view the files attached to this post.
-
- Posts: 3
- Joined: January 19th, 2021, 4:44 pm
Re: Little help
Thanks so much, JamX. My second problem must be elsewhere in my code, maybe when I convert mindex1_Price from a String to a number. I will investigate.
I really appreciate the time you took!
I really appreciate the time you took!