-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #404 from mozilla/Pat/update_beta_link
Pat/update beta link
- Loading branch information
Showing
4 changed files
with
71 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import requests | ||
from bs4 import BeautifulSoup | ||
|
||
beta_url = "https://ftp.mozilla.org/pub/firefox/releases/" | ||
|
||
# Fetch the page | ||
response = requests.get(beta_url) | ||
response.raise_for_status() | ||
|
||
# Parse the HTML content | ||
soup = BeautifulSoup(response.text, 'html.parser') | ||
|
||
latest_beta_num = -1 | ||
latest_beta_ver = "" | ||
|
||
# Extract the text of each line | ||
for line in soup.find_all('a'): | ||
line_text = line.getText().split(".") | ||
if len(line_text) < 2 or not line_text[0]: | ||
continue | ||
beta_num = int(line_text[0]) | ||
# Find the latest beta version | ||
if beta_num >= latest_beta_num: | ||
latest_beta_num = beta_num | ||
latest_beta_ver = line.getText()[:-1] | ||
|
||
print(latest_beta_ver) |