https://www.amazon.com/gp/css/order-history
.Invoice
text inside them as well as a link that points to https://www.amazon.com/gp/css/summary/print.html/ref=oh_aui_pi_o00_?orderID=123-1234567-1234567
, where order number is given by 123-1234567-1234567
. In the link, base url (//www.amazon.com
) might be omitted; so look for /gp/css/summary/print.html/ref=oh_aui_pi_o00_
.<a href='/gp/css/summary/print.html/ref=oh_aui_pi_o00_?ie=UTF8&orderID=123-1234567-1234567'>Invoice</a>
https://www.amazon.com/gp/your-account/order-history/ref=oh_aui_pagination_1_2?ie=UTF8&orderFilter=months-6&search=&startIndex=10
https://www.amazon.com/gp/your-account/order-history/ref=oh_aui_pagination_2_3?ie=UTF8&orderFilter=months-6&search=&startIndex=20
https://www.amazon.com/gp/your-account/order-history/ref=oh_aui_pagination_3_1?ie=UTF8&orderFilter=months-6&search=&startIndex=0
next
from page 1 to 2: https://www.amazon.com/gp/your-account/order-history/ref=oh_aui_pagination_1_2?ie=UTF8&orderFilter=months-6&search=&startIndex=10
next
from page 2 to 3: https://www.amazon.com/gp/your-account/order-history/ref=oh_aui_pagination_2_3?ie=UTF8&orderFilter=months-6&search=&startIndex=20
previous
from page 3 to 2: https://www.amazon.com/gp/your-account/order-history/ref=oh_aui_pagination_3_2?ie=UTF8&orderFilter=months-6&search=&startIndex=10
previous
from page 2 to 1: https://www.amazon.com/gp/your-account/order-history/ref=oh_aui_pagination_2_1?ie=UTF8&orderFilter=months-6&search=&startIndex=0
order history
page all while discarding duplicate entries.requests.Session
go to the invoice urls one by one. Sample url: https://www.amazon.com/gp/css/summary/print.html/ref=oh_aui_pi_o00_?orderID=123-1234567-1234567
pdfkit
to save file as a pdf with possibly the order number as part of filename.