dhowe / AdNauseam

AdNauseam: Fight back against advertising surveillance
GNU General Public License v3.0
4.61k stars 191 forks source link

Selenium test script #74

Closed dhowe closed 8 years ago

dhowe commented 8 years ago

Create a Selenium script that visits the top 10 news and top 10 entertainment sites with ADN installed

CyrusSUEN commented 8 years ago

Was modifying the repo: https://github.com/dhowe/AddonTestHarness on my branch.

Since there will be too much to merge I created a separate repo for this: https://github.com/CyrusSUEN/ADN2AutomatedTest

dhowe commented 8 years ago

Needs better instructions @CyrusSUEN how does the adn addon get loaded?

CyrusSUEN commented 8 years ago

Updated: https://github.com/CyrusSUEN/ADN2AutomatedTest/compare/ee04feabbd2f77adb5219e2df3ea27a0ccbe065c...3e03cc5ba3451ba06882ef75f3329f86663d9720

dhowe commented 8 years ago

@CyrusSUEN Next step is to run the tool on a bunch of pages, then export the collected json ads, then exit (first priority: Apr 5)

CyrusSUEN commented 8 years ago

exported ads for top news:

{
  "https://www.reddit.com/": {
    "https://www.reddit.com/::https://www.reddit.com///b.thumbs.redditmedia.com/o6J8XLMxXtq7nmouXEj6E_4LHh2EODBr77ZopfHhdFE.jpg": {
      "id": 1,
      "attempts": 1,
      "visitedTs": 1459839845877,
      "attemptedTs": 1459839845623,
      "contentData": {
        "src": "https://www.reddit.com///b.thumbs.redditmedia.com/o6J8XLMxXtq7nmouXEj6E_4LHh2EODBr77ZopfHhdFE.jpg"
      },
      "contentType": "img",
      "title": "Pending",
      "resolvedTargetUrl": "http://i.imgur.com/oxjAgrS.jpg",
      "foundTs": 1459839834259,
      "targetUrl": "http://i.imgur.com/oxjAgrS.jpg",
      "pageTitle": "reddit: the front page of the internet",
      "pageUrl": "https://www.reddit.com/",
      "errors": null,
      "domain": "www.reddit.com",
      "version": "2.0.5"
    },
    "https://www.reddit.com/::https://www.reddit.com///a.thumbs.redditmedia.com/Bc-g9L41l7KpBsb_IMNFZKxdcvsjGbYqZGTWcQAOzS8.jpg": {
      "id": 2,
      "attempts": 1,
      "visitedTs": 1459839841339,
      "attemptedTs": 1459839840616,
      "contentData": {
        "src": "https://www.reddit.com///a.thumbs.redditmedia.com/Bc-g9L41l7KpBsb_IMNFZKxdcvsjGbYqZGTWcQAOzS8.jpg"
      },
      "contentType": "img",
      "title": "What's the Most Popular Pet?",
      "resolvedTargetUrl": "http://www.livescience.com/32415-whats-the-most-popular-pet.html",
      "foundTs": 1459839834264,
      "targetUrl": "http://www.livescience.com/32415-whats-the-most-popular-pet.html",
      "pageTitle": "reddit: the front page of the internet",
      "pageUrl": "https://www.reddit.com/",
      "errors": null,
      "domain": "www.reddit.com",
      "version": "2.0.5"
    },
    "https://www.reddit.com/::https://www.reddit.com///a.thumbs.redditmedia.com/uUp2cTmW0CK4COt4Jk3xNrIaKAnCXRF-sEpdqJc_RK4.jpg": {
      "id": 3,
      "attempts": 1,
      "visitedTs": 1459839836230,
      "attemptedTs": 1459839835614,
      "contentData": {
        "src": "https://www.reddit.com///a.thumbs.redditmedia.com/uUp2cTmW0CK4COt4Jk3xNrIaKAnCXRF-sEpdqJc_RK4.jpg"
      },
      "contentType": "img",
      "title": "Imgur",
      "resolvedTargetUrl": "http://i.imgur.com/FFPsCxH.gifv",
      "foundTs": 1459839834269,
      "targetUrl": "http://i.imgur.com/FFPsCxH.gifv",
      "pageTitle": "reddit: the front page of the internet",
      "pageUrl": "https://www.reddit.com/",
      "errors": null,
      "domain": "www.reddit.com",
      "version": "2.0.5"
    }
  },
  "http://edition.cnn.com/": {
    "http://edition.cnn.com/::https://tpc.googlesyndication.com/simgad/9669067751103345513": {
      "id": 4,
      "attempts": 1,
      "visitedTs": 1459839861680,
      "attemptedTs": 1459839860630,
      "contentData": {
        "src": "https://tpc.googlesyndication.com/simgad/9669067751103345513"
      },
      "contentType": "img",
      "title": "mysale.hk - Join",
      "resolvedTargetUrl": "https://www.mysale.hk/join.aspx?referredby=c2c_HK_EN_display_topics_generic_ads&sc=4&c=3&ca=GenericFootwear&mkwid=cMe9ITL6z_dc&pcrid=103757915521&pkw=&pmt=&gclid=COuBwqL39ssCFdiOaAod9KIItg",
      "foundTs": 1459839852283,
      "targetUrl": "https://googleads.g.doubleclick.net/aclk?sa=l&ai=CENLkaGMDV_TjF8r89QXVmbSIBfmV898Hge_J9YIDsdH93wUQASCcuNorYNkCoAGPjo_SA8gBAqkC-HW3HeBqqT7gAgCoAwHIA5kEqgSbAU_Q9ZCbBnsHo2fGBirmGJ1zAtAIHP9S4Ob_atXlDZ2YviZ7Z1chfP-zO_8BmCfxF8vknTXbamINJAJOEwvvPS8d4329GPQhB-0jeZJla-UIKgbXfO4_pMzRyFqh3dE_YKtdYzyYxd1K3__zMI__5xfy5oFMvsF-Xo7PXTOyLaCdjlx5-2ycKMfmzI2XfS9I8w5g7K7LLPPyslrP4AQBoAYCgAfZ8fAtqAemvhvYBwHYEww&num=1&sig=AOD64_1AZz-GmRHFS4BFyztjs0KtSF40Yg&client=ca-pub-8566795000208645&adurl=http://www.mysale.hk/join.aspx%3Freferredby%3Dc2c_HK_EN_display_topics_generic_ads%26sc%3D4%26c%3D3%26ca%3DGenericFootwear%26mkwid%3DcMe9ITL6z_dc%26pcrid%3D103757915521%26pkw%3D%26pmt%3D",
      "pageTitle": "CNN - Breaking News, U.S., World, Weather, Entertainment & Video News",
      "pageUrl": "http://edition.cnn.com/",
      "errors": null,
      "domain": "edition.cnn.com",
      "version": "2.0.5"
    },
    "http://edition.cnn.com/::https://tpc.googlesyndication.com/simgad/16718853361774146057": {
      "id": 5,
      "attempts": 1,
      "visitedTs": 1459839856745,
      "attemptedTs": 1459839855629,
      "contentData": {
        "src": "https://tpc.googlesyndication.com/simgad/16718853361774146057"
      },
      "contentType": "img",
      "title": "ONAGOfly",
      "resolvedTargetUrl": "http://www.onagofly.com/?gclid=CKTSlqD39ssCFdSHaAodP44Jrw",
      "foundTs": 1459839852323,
      "targetUrl": "https://googleads.g.doubleclick.net/aclk?sa=l&ai=CiUxqaGMDV6qLI5Ok9AWFsp9YicbwzQjZguS15gLpv9V8EAEgnLjaK2DZAqABx8_wvQPIAQLgAgCoAwHIA5kEqgSYAU_QUbaNLqcJs9HvbQmYBFTNG0-MthdbtK1uI-T_qNNFx8wBVnZN17vVb1Uf7Db5iw4w4gwfqM9uopdFDgEacfdcv3CtzpeDAX9y3myUwijvPlQw_aMNgpT6eDfueMm7dqHw46C33N7I0JjXraFjtQSijtfT1p54RaWOA312ypgqGeO1OOLNOxmfIxPLpJq6Qiz3Viqjz4uY4AQBoAYCgAehsI9CqAemvhvYBwHYEwg&num=1&sig=AOD64_3FALJqxyv2MYc4Sl1q3Z5UE-3BBQ&client=ca-pub-8566795000208645&adurl=http://www.onagofly.com/",
      "pageTitle": "CNN - Breaking News, U.S., World, Weather, Entertainment & Video News",
      "pageUrl": "http://edition.cnn.com/",
      "errors": null,
      "domain": "edition.cnn.com",
      "version": "2.0.5"
    }
  },
  "http://www.nytimes.com/": {
    "http://www.nytimes.com/::https://tpc.googlesyndication.com/simgad/9669067751103345513": {
      "id": 6,
      "attempts": 1,
      "visitedTs": 1459839866648,
      "attemptedTs": 1459839865634,
      "contentData": {
        "src": "https://tpc.googlesyndication.com/simgad/9669067751103345513"
      },
      "contentType": "img",
      "title": "mysale.hk - Join",
      "resolvedTargetUrl": "https://www.mysale.hk/join.aspx?referredby=c2c_HK_EN_display_topics_generic_ads&sc=4&c=3&ca=GenericFootwear&mkwid=cMe9ITL6z_dc&pcrid=103757915521&pkw=&pmt=&gclid=CIyI8aT39ssCFVgWaAoduUoGFA",
      "foundTs": 1459839863401,
      "targetUrl": "https://www.googleadservices.com/pagead/aclk?sa=L&ai=C-RlbdGMDV7jTBMXIoAOdrpqoBfmV898Hge_J9YIDnImFngsQASDI1vUZYNkCoAGPjo_SA8gBAqkCa1eLgKiKqT7gAgCoAwHIA5kEqgSYAU_Q0_q75oZJaGVySCGRdqLzhOk7x3oX41GhqdZ1G7Y6TFBq9h_IbrE8QOu73819arI71UIfuCS-7KMFHk_I5J-IEGZPnLqX-E1b4E5FGD8OiCQzJm8p2E1vqyc6ZgfqWUl1X2o2jF5rQVcB3jJXxWyGrU1tb9gJ9I-EvrVwWlOuxA9K2y14evAqz-REJBrC3ygVIqFg3QRB4AQBiAYBoAYCgAfZ8fAtqAemvhvYBwHYEww&num=1&cid=5GhRAyxFu3DxS8aC7qmiEhlo&sig=AOD64_1yKuNj1qEFhpbQ1a582qey3x3Lgg&client=ca-pub-4177862836555934&adurl=http://www.mysale.hk/join.aspx%3Freferredby%3Dc2c_HK_EN_display_topics_generic_ads%26sc%3D4%26c%3D3%26ca%3DGenericFootwear%26mkwid%3DcMe9ITL6z_dc%26pcrid%3D103757915521%26pkw%3D%26pmt%3D",
      "pageTitle": "The New York Times - Breaking News, World News & Multimedia",
      "pageUrl": "http://www.nytimes.com/",
      "errors": null,
      "domain": "www.nytimes.com",
      "version": "2.0.5"
    }
  },
  "http://www.huffingtonpost.com/": {
    "http://www.huffingtonpost.com/::http://aka-cdn-ns.adtech.de/images/Default_Size_16_1x1.gif": {
      "id": 7,
      "attempts": 1,
      "visitedTs": 1459839882486,
      "attemptedTs": 1459839880644,
      "contentData": {
        "src": "http://aka-cdn-ns.adtech.de/images/Default_Size_16_1x1.gif"
      },
      "contentType": "img",
      "title": "ONE by AOL: Ad Server",
      "resolvedTargetUrl": "http://oneadserver.aol.com/",
      "foundTs": 1459839880243,
      "targetUrl": "http://ad.dc2.adtech.de/?adlink/737/4756715/93317943/0/AdId=-3;BnId=0;itime=839875427;impref=14598398762533360222;imprefseq=82472365862211039;imprefts=1459839876;",
      "pageTitle": "Breaking News and Opinion on The Huffington Post",
      "pageUrl": "http://www.huffingtonpost.com/",
      "errors": null,
      "domain": "www.huffingtonpost.com",
      "version": "2.0.5"
    }
  }
}

top recreation:

{
  "https://www.southwest.com/": {
    "https://www.southwest.com/::https://www.southwest.com//assets/images/globalnav/ads/header_navigation_rr_25000_chaseEN.jpg": {
      "id": 1,
      "attempts": 3,
      "visitedTs": -1459839451799,
      "attemptedTs": 1459839431790,
      "contentData": {
        "src": "https://www.southwest.com//assets/images/globalnav/ads/header_navigation_rr_25000_chaseEN.jpg"
      },
      "contentType": "img",
      "title": "Failed",
      "resolvedTargetUrl": null,
      "foundTs": 1459839412050,
      "targetUrl": "https://creditcards.chase.com/a1/southwest/25KPremier?CELL=6PLT",
      "pageTitle": "Southwest Airlines | Book Flights, Airline Tickets, Airfare",
      "pageUrl": "https://www.southwest.com/",
      "errors": [
        "503 (Service Unavailable) undefined",
        "0 () timeout",
        "0 () timeout"
      ],
      "domain": "www.southwest.com",
      "version": "2.0.5"
    }
  },
  "http://www.xe.com/": {
    "http://www.xe.com/::https://tpc.googlesyndication.com/simgad/2950348639070775507": {
      "id": 2,
      "attempts": 1,
      "visitedTs": 1459839417890,
      "attemptedTs": 1459839416779,
      "contentData": {
        "src": "https://tpc.googlesyndication.com/simgad/2950348639070775507"
      },
      "contentType": "img",
      "title": "mysale.hk - Join",
      "resolvedTargetUrl": "https://www.mysale.hk/join.aspx?referredby=c2c_HK_EN_display_topics_generic_ads&sc=4&c=3&ca=GenericFootwear&mkwid=cYk2naTsF_dc&pcrid=103757913481&pkw=&pmt=&gclid=COL59s719ssCFc4SaAodV8IO3A",
      "foundTs": 1459839416749,
      "targetUrl": "http://www.googleadservices.com/pagead/aclk?sa=L&ai=CQx5Ot2EDV-n4IsKD9gXYmqD4BPmV898Hid_J9YIDpIiFngsQASD0g4sEYNkCoAGPjo_SA8gBAqkCnvWn2Ap2qT6oAwHIA8EEqgRmT9DV8j08M0w71zZm834DILCIj21QDpPXofg-Lm9W3zzXYBwzuZKLmMCO961IXpbeHaIm4dD_GU9lHE7Ino1x_gQi2rXxkFhoblQZ57JizKyflZYqWuhWGMZ3aBJXAe5xBrYFMgOBiAYBoAYCgAfZ8fAtqAemvhvYBwHYEww&num=1&cid=5GjH46AtjUrbNBWaOkObABDs&sig=AOD64_0NiWlMLMBjAOho5sBMIPJeoyTmHA&client=ca-pub-2110917264626924&adurl=http://www.mysale.hk/join.aspx%3Freferredby%3Dc2c_HK_EN_display_topics_generic_ads%26sc%3D4%26c%3D3%26ca%3DGenericFootwear%26mkwid%3DcYk2naTsF_dc%26pcrid%3D103757913481%26pkw%3D%26pmt%3D",
      "pageTitle": "XE - The World's Trusted Currency Authority",
      "pageUrl": "http://www.xe.com/",
      "errors": null,
      "domain": "www.xe.com",
      "version": "2.0.5"
    }
  }
}
dhowe commented 8 years ago

@CyrusSUEN please create tickets here for whatever bugs you found when attempting to collect ads via selenium (then close this ticket)

CyrusSUEN commented 8 years ago

Selenium script updated: https://github.com/dhowe/AddonTestHarness/pull/7 Closing this one.