Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upGoogle Books #2052
Conversation
This comment has been minimized.
This comment has been minimized.
I guess that this then fixes #2049. |
Looks fine in general. Just a few comments. It is bad, that the authors in the test cases are multiplied with different name variants, but this is completely Google's fault and I don't see a way for us to fix it here. |
var items = {}; | ||
var found = false; | ||
// TODO: adjust the CSS selector | ||
var rows = doc.querySelectorAll('div.bHexk>a, div.Q9MA7b>a'); |
This comment has been minimized.
This comment has been minimized.
zuphilip
Nov 9, 2019
Collaborator
This looks fragile. Does this works in searches, e.g. https://www.google.com/search?tbm=bks&ei=NRnHXff-DZKdkgWItKagBg&q=adam+smith&oq=adam+smith ?
This comment has been minimized.
This comment has been minimized.
adam3smith
Nov 10, 2019
Author
Collaborator
yeah, the first one works for all regular searches, the 2nd one for all google play ones. Will add a comment to explain. I know the class names look wonky, but I looked through quite a number of different versions & searches and it worked everywhere. The alternative would be a longer div
tree without attribute, which I felt was more fragile.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Thanks -- fixed or responded. Yeah, I looked for a solution to the author issue, but they're not just in the XML data but also in the page and the bibtex Google offer for the new google books layout, so I really wouldn't know how to avoid them. |
This comment has been minimized.
This comment has been minimized.
@adam3smith Let me know when you could look into the open problem #2052 (comment) and fix it. |
This comment has been minimized.
This comment has been minimized.
@zuphilip please take another look. Could you check if the playstore works for you / looks the same for you? I'm worried that class also changes depending on locale/user account/googles current mood |
Yes, the books on playstore work for me as well. That is fine. I have two more suggestions/comments. |
"creator": "Simon Kornblith, Michael Berkowitz and Rintze Zelle", | ||
"target": "^https?://(books|www)\\.google\\.[a-z]+(\\.[a-z]+)?/(books(/.*)?\\?(.*id=.*|.*q=.*)|search\\?.*?(btnG=Search\\+Books|tbm=bks))|^https?://play\\.google\\.[a-z]+(\\.[a-z]+)?/(store/)?(books|search\\?.+&c=books)", | ||
"creator": "Simon Kornblith, Michael Berkowitz, Rintze Zelle, and Sebastian Karcher", | ||
"target": "^https?://(books|www)\\.google\\.[a-z]+/(books(/.*)?\\?(.*id=.*|.*q=.*)|search\\?.*?(btnG=Search\\+Books|tbm=bks)|books/edition/)|^https?://play\\.google\\.[a-z]+(\\.[a-z]+)?/(store/)?(books|search\\?.+&c=books)", |
This comment has been minimized.
This comment has been minimized.
zuphilip
Nov 21, 2019
Collaborator
What about audiobooks, e.g. https://play.google.com/store/audiobooks/details/Arthur_Conan_Doyle_Der_Hund_von_Baskerville?id=AQAAAECM-EG43M which is also linked in the test case below?
This comment has been minimized.
This comment has been minimized.
zuphilip
Nov 21, 2019
Collaborator
Moreover, also the following link is possible https://play.google.com/store/search?c=books&q=kling but not recognized.
This comment has been minimized.
This comment has been minimized.
@zuphilip if you'd take another look? |
This comment has been minimized.
This comment has been minimized.
Great! Thank you @adam3smith ! This is now squashed and merged |
adam3smith commentedNov 8, 2019
Account for new format, simplify