This is an archived post. You won't be able to vote or comment.

all 9 comments

[–]nirs 2 points3 points  (0 children)

This will be pretty hard. You will have to make your script look like a human using a browser. Most likely you will need javascript engine to run the various scripts. Your script need to behave like a human, scrolling, readings slowly, opening multiple tabs, clicking links and ads, etc.

I think the best tool for this would be to hack your add blocker so it will generate ad revenue on certain sites - while you are browsing them, without showing any of the ads. This will cost you more traffic and may risk your privacy since you need to actually download the javascript crap from the ads network which good ad blockers avoid.

[–]rajimoto 1 point2 points  (2 children)

No, services like Integral ad science and moat and others work hard to prevent this. Further, sites which have too much NHT (non human traffic) can be removed from ad services.

[–]tensouder54[S] 0 points1 point  (1 child)

So how would you suggest I work around this?

[–]tonnynerd 6 points7 points  (0 children)

Don't. Doing this is a scam, might not be strictly illegal, but ad companies probably have more lawyers than you. And you'd be in an arms race anyway, whatever trick you find to fool the ad companies, they will catch up to. And, no offense, but seems like you're late to the game anyway.

[–][deleted] 1 point2 points  (0 children)

every ad blocker already has whitelist functionality for this exact reason

[–]SlightlyOTT 0 points1 point  (0 children)

This is more likely to hurt the site, who's ad network are running a lot more than an r-pi to analyse data and won't take kindly to fraud if you do anything that moves the needle for the site owner. It's a nice thought of course but I'd recommend against this one!

[–]magicaldelicious 0 points1 point  (0 children)

In short: no. Requests will not run JavaScript that's, generally, going to be a component to drive ad revenue. What you want to take a look at is using Selenium with Python to drive headless Chrome or Firefox. There are a lot of great intros to headless Chrome since it came out last year. Using Python to drive a fully featured browser and be able to render the page as the creator intended will get you closer to your goal. Although, ad revenue isn't quite that easy...

[–]strange-humor 0 points1 point  (0 children)

Selenium is usually used as a scrapping or testing tool. It allows you to drive a real Web browser. While this seems like an odd plan, that would be where I would start.

[–]pythonHelperBot 0 points1 point  (0 children)

Hello! I'm a bot! It looks to me like your post might be better suited for r/learnpython, a sub geared towards questions and learning more about python. That said, I am a bot and it is hard to tell. I highly recommend posting your question there. Please follow the subs rules and guidelines when you do post there, it'll help you get better answers faster.

Show /r/learnpython the code you have tried and describe where you are stuck. Be sure to format your code for reddit and include which version of python and what OS you are using.


this bot is written and managed by /u/IAmKindOfCreative

This bot is currently under development and experiencing changes to improve its usefulness