Does Facebook know I'm scraping it with PhantomJS and can it change its website to counter me?

前端 未结 1 1490
时光说笑
时光说笑 2021-01-26 10:53

So, maybe I\'m being paranoid.

I\'m scraping my Facebook timeline for a hobby project using PhantomJS. Basically, I wrote a program that finds all of my ads by querying

1条回答
  •  执笔经年
    2021-01-26 11:22

    It is perfectly possible to detect PhantomJS even if the useragent is spoofed. There are plenty of litte ways in which it differs from other browsers, among others:

    • Wrong order of headers
    • Lack of media plugins and latest JS capabilities
    • PhantomJS-specific methods, like window.callPhantom
    • PhantomJS name in the stack trace

    and many others.

    Please refer to this excellent article and presentation linked there for details: https://blog.shapesecurity.com/2015/01/22/detecting-phantomjs-based-visitors/

    Maybe puppeteer would be a better fit for your needs as it is based on a real cutting-edge Chromium browser.

    0 讨论(0)
提交回复
热议问题