The merge proposal page seems to have changed a bit, fix up the script to match the page

This commit is contained in:
Raoul Snyman 2018-05-04 14:14:04 -07:00
parent 4b5e03a357
commit 1d30217256

View File

@ -94,17 +94,18 @@ def get_merge_info(url):
print('Unable to load merge URL: {}'.format(url)) print('Unable to load merge URL: {}'.format(url))
return None return None
soup = BeautifulSoup(page.read(), 'lxml') soup = BeautifulSoup(page.read(), 'lxml')
# Find this span tag that contains the branch url # Find the span tag that contains the branch url
# <span class="branch-url"> # <span class="branch-url">
span_branch_url = soup.find('span', class_='branch-url') span_branch_url = soup.find('span', class_='branch-url')
if not span_branch_url: if not span_branch_url:
print('Unable to find merge details on URL: {}'.format(url)) print('Unable to find merge details on URL: {}'.format(url))
return None return None
merge_info['branch_url'] = span_branch_url.contents[0] merge_info['branch_url'] = span_branch_url.contents[0]
# Find this tag that describes the branch. We'll use that for commit message # Find the p tag that contains the commit message
# <meta name="description" content="..."> # <div id="commit-message">...<div id="edit-commit_message">...<div class="yui3-editable_text-text"><p>
meta = soup.find('meta', attrs={"name": "description"}) commit_message = soup.find('div', id='commit-message').find('div', id='edit-commit_message')\
merge_info['commit_message'] = meta.get('content') .find('div', 'yui3-editable_text-text').p
merge_info['commit_message'] = commit_message.string
# Find all tr-tags with this class. Makes it possible to get bug numbers. # Find all tr-tags with this class. Makes it possible to get bug numbers.
# <tr class="bug-branch-summary" # <tr class="bug-branch-summary"
bug_rows = soup.find_all('tr', class_='bug-branch-summary') bug_rows = soup.find_all('tr', class_='bug-branch-summary')