import calendar
year = 2015
print [
list(range(1, calendar.monthrange(year, month)[1] + 1))
for month in range(1, 13)
]
In [1]: for counter in range(1, 11):
...: print(".//*[@id='b_results']/li[{}]/div[2]/div/cite".format(counter))
...:
.//*[@id='b_results']/li[1]/div[2]/div/cite
.//*[@id='b_results']/li[2]/div[2]/div/cite
.//*[@id='b_results']/li[3]/div[2]/div/cite
.//*[@id='b_results']/li[4]/div[2]/div/cite
.//*[@id='b_results']/li[5]/div[2]/div/cite
.//*[@id='b_results']/li[6]/div[2]/div/cite
.//*[@id='b_results']/li[7]/div[2]/div/cite
.//*[@id='b_results']/li[8]/div[2]/div/cite
.//*[@id='b_results']/li[9]/div[2]/div/cite
.//*[@id='b_results']/li[10]/div[2]/div/cite
import sys
print([
[
cell.strip() for cell in line.split('|') if cell.strip()
] for line in open(sys.argv[1], "r") if line.startswith('|')
])