Well, considering that the quoted reply was around a year ago and Yahoo had the habit of constantly changing their page source in the meantime, it's no wonder. I was working for a regex pattern for a post in another thread (dealing with Yahoo weather as well), but it takes a while to make it right and complete, while I currently have other projects that I want to finish. The RegExp option pattern is unfinished of course, as it was meant to be a full solution (til Yahoo decides to change their page source again, that is), but it's somewhat similar to those already existing:
Code: Select all
(?siU)<div class="weather-details-wrapper.*>.*<div id=module-location-heading.*>.*<h1 .*>(.*)<\/h1>.*<h2 .*>(.*)<\/h2>.*<img .*>.*<p .*>(.*)<\/p>.*<span .*>(.*)(?:°)?<\/span>.*<svg .*>.*<span .*>(.*)(?:°)?<\/span>.*<div class="temperature-forecast.*>.*<span .*>(.*)<\/span>.*<span .*>.*<\/span>.*<div id=module-weather-forecast.*>.*<ul class="hourlyForecast.*>.*<li .*>.*<time>(.*)<\/time>.*<div class="item temperature.*>.* alt=(.*)>.*<dd .*>(.*)<\/dd>.*<\/div>.*<div class="item precipitation.*>.*<dt>(.*)<\/dt>.*<\/div>.*<div class="item wind.*>.*<dd .*>(.*)<\/dd>.*<\/div>.*<\/li>.*<table class=.*dailyForecast.*>(.*)<div id=module-weather-precipitation.*>.*<div id=module-weather-wind-pressure.*>.*<div id=module-weather-details.*>.*<div id=module-weather-sun-moon.*>.*<div id=module-weather-map.*>.*
The thing is just a matter of investigating the webpage's source text (with or without right clicking to "Inspect" the elements and taking into account that the former shows a formatted version compared to the source, e.g. quotes might be present there while missing in the source and so on) and adding the proper regex pattern after the part I mentioned above. It's not terribly hard if you have a PCRE flavor configured site like RegExr.com or RegEx101.com to assist you in testing, but it requires a basic regular expression knowledge, some focus, patience, and obviously time.