Skip to content

Instantly share code, notes, and snippets.

@cxkoda
Last active September 7, 2020 08:05
Show Gist options
  • Select an option

  • Save cxkoda/8afcc4ac7cf99590939044ae01d1b960 to your computer and use it in GitHub Desktop.

Select an option

Save cxkoda/8afcc4ac7cf99590939044ae01d1b960 to your computer and use it in GitHub Desktop.
Fetch the A&A submission status using python
import requests
from bs4 import BeautifulSoup
import argparse
def getData(author, article):
with requests.Session() as session:
# Fetch Data from server
payload = {
'codeauteur': author,
'refarticle': article,
}
response = session.post('https://mms-aanda.obspm.fr/is/aa/detail.php', data=payload)
# Find Table
soup = BeautifulSoup(response.text, 'html.parser')
table = soup.find_all("table")[-1]
# Parse entries
table = [[entry.text for entry in row.findAll('td')] for row in table.findAll('tr')]
return table
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Fetch A&A submission status')
parser.add_argument('author', help='The A&A author ID')
parser.add_argument('article', help='The A&A article reference number')
args = parser.parse_args()
data = getData(args.author, args.article)
print(f'{args.article} ({args.author})')
print('\n'.join([f'{date} {status}' for (date, status) in data[1:]]))
print('----------')
@cxkoda
Copy link
Author

cxkoda commented Sep 7, 2020

init

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment