Output title of claimed book and newest owned book.
This commit is contained in:
+5
-1
@@ -31,9 +31,13 @@ g.doc.submit()
|
|||||||
g.doc.save('/tmp/free-learning-after-login.html')
|
g.doc.save('/tmp/free-learning-after-login.html')
|
||||||
g.doc.text_assert('"sid":')
|
g.doc.text_assert('"sid":')
|
||||||
g.doc.text_assert('Claim Your Free eBook')
|
g.doc.text_assert('Claim Your Free eBook')
|
||||||
|
claim_book = g.doc.select('//div[@class="dotd-title"]/h2').text()
|
||||||
|
print("Book: {}".format(claim_book))
|
||||||
claim_url = g.doc.select('//a[@class="twelve-days-claim"]/@href').text()
|
claim_url = g.doc.select('//a[@class="twelve-days-claim"]/@href').text()
|
||||||
print("Claim URL: " + claim_url)
|
print("Claim URL: {}".format(claim_url))
|
||||||
g.go(claim_url)
|
g.go(claim_url)
|
||||||
g.doc.save('/tmp/free-learning-after-claim.html')
|
g.doc.save('/tmp/free-learning-after-claim.html')
|
||||||
g.doc.text_assert('<h1>My eBooks </h1>')
|
g.doc.text_assert('<h1>My eBooks </h1>')
|
||||||
print("Claim successful.")
|
print("Claim successful.")
|
||||||
|
last_claimed_title = g.doc.select('(//div[@id="product-account-list"]/div)[1]/@title').text()
|
||||||
|
print("Last claimed book: {}".format(last_claimed_title))
|
||||||
|
|||||||
Reference in New Issue
Block a user