• 93 Posts
  • 2.53K Comments
Joined 3 years ago
Aquileo | cake
Cake day: June 22nd, 2023

Aquileo | help-circle


  • solrize@lemmy.mltoFediverse@lemmy.worldBlock lemmy.ml if lemmy feels tirening.
    Aquileo | link
    Aquileo | fedilink
    English
    Aquileo | arrow-up
    10
    Aquileo | arrow-down
    1
    ·
    5 hours ago

    It’s a long story but basically after some stupid drama, lemmy.world banned discussion of cat food unless there was scientific evidence presented that the cat food was healthy for the cat. The drama had been about vegan cat food discussions in the vegan discussion group. Vegan cat food turns out to be a thing and appears to have enough approvals to be sold in pet stores, but people on .world wanting to talk about it should come over here to .ml. No I wasn’t a participant in the vegan group discussion itself. I made some posts in the surrounding drama thread that you can probably find in my .world profile from shortly after I joined.









  • The BS (trackers etc.) are on the web sites and you get them automatically unless your browser either actively filters them out, or implements an incomplete enough part of present-day web protocols that they don’t receive the trackers (e.g. by not supporting Javascript).

    Unfortunately, filtering trackers is a never-ending arms race, while using a browser for the “historical web” makes a lot of present-day sites inaccessible.

    I.e. the problem is the web itself, not the browser, for the most part.

    I use Firefox but have fairly aggressive umatrix origin (ad blocker) settings, if that helps.




  • I tried wget and got a small index file that looks like a bot challenge, maybe Cloudflare Turnstile. I don’t know of a simple automated workaround. But, Turnstile gives you a rewritten url that then goes back to the forum page and sets a cookie, iirc. So if you can visit the page with a real browser, then save the cookie and transfer it to wget (there’s some option to set an arbitrary header) that’s one thing to try.

    There’s another hack used by fanfiction.net readers, where if you want to save a multi-page story, you can manually visit each page with a browser, i.e. click “next” again and again to load all the pages. Up to a few dozen such clicks isn’t so bad. Fanficfare (fanfic downloading program, sometimes abbreviated FFF, https://github.com/JimmXinu/FanFicFare ) then has an option to retrieve the pages from your on-disk browser cache instead of trying to get them from the remote server. That’s another approach you can try, either with fanficfare or your own scripts.

    The site you’re looking at uses xenforo which is a very popular forum server program. The actual layout of xenforo sites varies, but fanficfare probably already recognizes something similar, so try using one of those interfaces. I think spacebattles.net (another fic site) uses xenforo and FFF supports it, so it might be a good start. You will have to modify FFF to recognize civfanatics instead of spacebattles. It will help to know or pick up some Python, but you shouldn’t have to become an expert.

    Added: if you really want to automate your scrape, you will have to orchestrate a browser as mentioned earlier. IDK if there is code around to already do it. If you can program, it’s not terribly hard to use Puppeteer or Selenium, but it will take some farting around to deal with the site layout and anti-bot stuff. It’s not guaranteed to work right off the bat, but with enough determination you can do it, especially if your scrape volume is low and you can run it slowly. I’m not deeply involved in this stuff (like you, I just occasionally want to download something for personal use) but there are tons of webpages and articles by people (who I’d mostly consider evil) who do it at scale.



  • You’re trying to run a scraper, and unfortunately a lot of AI companies are doing the same thing on such a big scale that it creates a DOS attack. So lots of sites now have anti-scraping measures. I clicked the forum link and saw a brief interstitial that looked like bot protection.

    I’m unfamiliar with httrack but wget fails pretty often by the site just rejecting the user agent. Try “wget -Dfoo [url]” to save the response headers in the file “foo”, if I remember it right. That will let you check if there is an error code. You could also examine the too-small html index that you got, to see if it has error messages inside.

    Sometimes curl works when wget fails. For both of them, there are CLI options to set the user agent to something different.

    Getting images from forums often requires you to have a login cookie in your client. It’s simplest to log into the site and then paste the cookie into your scraping program or script.

    The next thing after wget/curl would be to write a scraping script (say with python urrlib) that can analyze the html a little as it goes. The thing after that would be script an actual browser, with puppeteer or selenium etc.

    Regarding the links pointing to your local disk, that’s probably because they are relative links, like “href=./foobar.html”. You can make them point to the remote server by inserting an HTML BASE tag into the top of the file, like <BASE HREF=“https://whateveritwas.com/forum”> or whatever. If it’s just for one or two pages you can do that manually. Otherwise, modify your scraping script to insert it, before or after saving the output.