question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

README.md practical.json example misses Book 2

See original GitHub issue

Due to some unfortunate formatting on the homepage of A Practical Guide to Evil, the example from the README.md will only download books 1, 3, 4, and 5. This can be fixed by complicating the chapter selector somewhat, though there is probably a nicer way to go about it.

Current practical.json

{
    "url": "https://practicalguidetoevil.wordpress.com/table-of-contents/",
    "title": "A Practical Guide To Evil: Book 1",
    "author": "erraticerrata",
    "chapter_selector": "#main .entry-content > ul > li > a",
    "content_selector": "#main .entry-content",
    "filter_selector": ".sharedaddy, .wpcnt, style",
    "cover_url": "https://gitlab.com/Mikescher2/A-Practical-Guide-To-Evil-Lyx/raw/master/APGTE_1/APGTE_front.png"
}

Proposed practical.json

{
    "url": "https://practicalguidetoevil.wordpress.com/table-of-contents/",
    "title": "A Practical Guide To Evil",
    "author": "erraticerrata",
    "chapter_selector": "#main .entry-content > ul > li > ul > li > a, #main .entry-content > ul > li > a",
    "content_selector": "#main .entry-content",
    "filter_selector": ".sharedaddy, .wpcnt, style",
    "cover_url": "https://gitlab.com/Mikescher2/A-Practical-Guide-To-Evil-Lyx/raw/master/APGTE_1/APGTE_front.png"
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kemayocommented, Sep 9, 2020

I altered the readme in 9c9877ed26fc441cb7d50cde2ca27f71994afbba in, admittedly, the opposite direction – I made it actually download just book 1 like it said it would.

I also took the opportunity to update the practical guide JSON in the examples folder, to show how to mix in the extras chapters when they were published.

If what you want is the entire series in one file, including all the extras, you could do this:

{
    "url": "https://practicalguidetoevil.wordpress.com/2015/03/25/prologue/",
    "title": "A Practical Guide To Evil",
    "author": "erraticerrata",
    "content_selector": "#main .entry-wrapper",
    "content_title_selector": "h1.entry-title",
    "content_text_selector": ".entry-content",
    "filter_selector": ".sharedaddy, .wpcnt, style",
    "next_selector": "a[rel=\"next\"]"
}
0reactions
TheMetalCentercommented, Oct 18, 2020

BeautifulSoup has a dependency on a package called soupsieve that actually handles the selectors, so it’s possible it’s just that which is outdated.

Got it working! Used a clean python3.9 and it was working as expected, so then went back to the python3.8 to try and troubleshoot why it wasn’t working there. Apparently, I had “bs4” installed as bs4 version 4.6.3 but also had “beautifulsoup4” installed as beautifulsoup4 4.9.3. It said bs4 was fully up to date, so I just uninstalled it and it started working, I guess defaulting to beautifulsoup4.

Thanks for the help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

JSON Tutorial: Learn with Simple File Format EXAMPLE
The given code example defines how to use JSON to store information related to programming books along with edition and author name. {...
Read more >
JSON Tutorial - w3resource
This tutorial begins a set of tutorials on JSON and discusses definition, specification, What JSON looks like in real world, a bit of...
Read more >
Using JSON in Go: A guide with examples - LogRocket Blog
JSON is one of the most-used formats for storing data. In this guide, learn how to work with JSON in Go using the...
Read more >
How to Model Data: A Guide To JSON Data Modeling
The first two links talk about a period of time before JSON when it ... on modeling data in JSON and provided JSON...
Read more >
Working With JSON Data in Python
In this tutorial you'll learn how to read and write JSON-encoded data using Python. You'll see hands-on examples of working with Python's built-in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found