Apr 3, 2013

How to setup a completely headless browser with Flash support on your linux server

Environment setup

PhantomJS is a beautufil product to launch a headless web browser or your linux server. This can be used to automate a large amounts of tasks which can't be processed with raw curl.

So we have CentOS release 5.7 (Final), 32bit, and need to get completely loaded websites with Flash support. PhantomJS isn't supported Flash plugin since 1.5.0, so we need to use 1.4.1 version. All components can be installed via these guides: rhythmicalmedia.com/?p=146 and code.google.com/p/phantomjs/wiki/XvfbSetup. All should be OK (maybe except the GIT insallation - but phantomjs-1.4.1 is in source code, so no actual usage of GIT).

To start Xvfb you need to add these strings to /etc/init.d/Xvfb

# chkconfig: 345 99 50
# description: Simple graphical server

To make chkconfig work with it. You may need xfvb-run script, one can be obtained from here www.minecraftwiki.net/wiki/Programs_and_Editors/Tectonicus/VPS.

Flash plugin installation routine

rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux
yum check-update
yum -y install flash-plugin nspluginwrapper

Command line must contain option --load-plugins=yes - so the correct ones will be

export LIBXCB_ALLOW_SLOPPY_LOCK=1;DISPLAY=:0 ./phantomjs --load-plugins=yes ../examples/rasterize.js URL SCREENSHOT_FILE

or

export LIBXCB_ALLOW_SLOPPY_LOCK=1;xvfb-run --server-args="-screen 0, 1024x768x24" ./phantomjs --load-plugins=yes ../examples/rasterize.js URL SCREENSHOT_FILE

Also to emulate Flash support in phantomjs browser you need to add before page.open the following (at least plugins and mimeTypes - to pass all Flash detection tests correctly)

page.onInitialized = function () {
        page.evaluate(function () {
            window.navigator = {
                plugins: {length: 2, 'Shockwave Flash': {name: 'Shockwave Flash', description: 'Shockwave Flash 11.6 r602'}},
                mimeTypes: {length: 2, "application/x-shockwave-flash":
                    {description: "Shockwave Flash", suffixes: "swf", type: "application/x-shockwave-flash", enabledPlugin: {description: "Shockwave Flash 11.6 r602"}}
                },
                appCodeName: "Mozilla",
                appName: "Netscape",
                appVersion: "5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22",
                cookieEnabled: true,
                language: "en",
                onLine: true,
                platform: "CentOS 5.7",
                product: "Gecko",
                productSub: "20030107",
                userAgent: "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22",
            };
        });
};

If you have any troubles with failed flahs plugin initialization (on screenshots) you may need to downgrade to version 10 by the following command

yum erase flash-plugin
rpm -ivh http://dl.atrpms.net/el5-i386/atrpms/bleeding/flash-plugin-10.2-1.i386.rpm

All this makes headless PhantomJS browser work with modern Flash websites.

98 comments:

  1. Hi.

    I have Ubuntu 12 and I am trying to run phantomjs 1.4.1 on a flash site.
    Anyway I do it I get the same output, either "this page requires flash" if I don't include the "onInitialized" function, or a blank page if I include it.
    Using the --load-plugins=yes parameter makes no difference.

    I am using flash v11.2 r202 and I am finding it hard to install a different version. I have the .so file for v10 but I don't know what to do with it.

    Any idea what I could be doing wrong in order to render flash sites correctly?

    Thanks.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. HELLPP! I'm an inexperienced computer user, but I know one effective method when there are such problems. I often play various browser games, this is my way to relieve stress after a hard day's work. When problems occur, I immediately download the desired software and reinstall it, for example for browser games, you often need to reinstall it https://yumdownload.com/adobe-shockwave-player . I do this with all the software and even with the operating system.

    ReplyDelete
  5. Does grooming your own dog seem too hard? Use these 7 simple all breed dog grooming tips and give your dog that pristine look without breaking the CBD oil for dogs. These step by step tips teach you how to bathe, clip, and nail clip easily and quickly.

    ReplyDelete
  6. Do you have pets and are concerned about leaving them when you travel? Have you worn out your favors with neighbors, family and friends? Have you had bad experiences with pet sitters who have claimed to be reliable and trustworthy and then found out the hard way there was cause for concern. The intention of this article is to help you in the process of finding a trustworthy, reliable and professional Cat names sitter for your needs.

    ReplyDelete
  7. This article is directed at veterans who suffer from PTSD and Depression. It provides summary information on the holistic techniques that can be used to reverse PTSD and Depression in Veterans. These techniques include meditation, emotional release, diet, exercise, yoga, mindfulness, herbal remedies, Reiki and other forms of energy healing and CBD for sale Conventional treatment includes pharmaceutical drugs and talk therapy, which do not seem to work. The holistic approach includes mind, body and spirit techniques that can be integrated with conventional treatment.

    ReplyDelete
  8. Baby dresses are going to be in direct contact with baby skin, and for this reason you should use mild detergents when washing baby dresses. cheap flower girl dresses do get a lot of things spilled, or spewed, onto them, and these spills often cause stains. The mild detergents are not as good at removing stains so you will need to take some precautions to keep the baby dresses clean and looking good.

    ReplyDelete
  9. Both tetrahydrocannabivarin (THCV) and cannabidiol (CBD) are phytochemicals similar to the active ingredient in marijuana, but without the psychoactive effects. According to a report published in the journal Diabetes Care in August 2016, both molecules could be helpful in treating high blood sugar levels in people who have been diagnosed with Type 2 diabetes. Scientists at the University of Nottingham in cbd and several other research institutions in the UK looked at 62 participants with a Type 2 diabetes diagnosis.

    ReplyDelete
  10. Great post mate, thank you for the valuable and useful information. Keep up the good work! FYI, please check these depression, stress and anxiety related articles:

    Depression Cure

    Depression Management Tips

    Dealing With Depression

    Ways To Get Rid of Depression

    Overcoming Depression


    you can also contact me at depressioncure.net@gmail.com for link exchange, article exchange or for advertisement.

    Thanks

    ReplyDelete
  11. As with any major city, the cost of parking in the Sydney CBD can be out of control. Fortunately, there are solutions. There is a multitude of private owners of parking space out there who are willing to sell or rent parking space https://royalcbd.com/

    ReplyDelete
  12. This is a very good tip particularly to those fresh to the blogosphere.Short but very accurate info… Many thanks for sharing this one.A must read article!my web blog 123Movies

    ReplyDelete
  13. Great Post! I look forward to seeing more from you in the future. There are some very great ideas above Fmovies

    ReplyDelete
  14. Good post! We will be linking to this particularly great post on our website.Keep up the good writing. Yesmovies

    ReplyDelete
  15. Assignment help is given the full profession lift to the students in which we control the students to make the correct stride throughout everyday life and show signs of improvement opportunity throughout Solarmovie

    ReplyDelete
  16. Its very useful, without read your article, it hard to think about. Thank you so much Jav Online

    ReplyDelete
  17. That’s true, i have same opinion with you about this. We should together figure this out Jav Streaming

    ReplyDelete
  18. Thank for your support and very preciate that. What an useful articles Japanese Porn

    ReplyDelete
  19. Thank you and thank for your shared, i will introduce to my friend to visit your website more often
    Jav Censored

    ReplyDelete
  20. Marvelous, what a weblog it is! This website presents helpful information to us, keep it 123Movies

    ReplyDelete
  21. I wish I could craft such articles as this. Thank you very much.
    123Movies
    Movies123
    FMovies
    YesMovies

    ReplyDelete
  22. There as certainly a great deal to find out about this topic. I really like all of the points you made. Bệnh Lậu

    ReplyDelete
  23. 123movies. it will help you to watch and download movies and TV Shows in any quality.

    ReplyDelete
  24. Greenstore Dispensary is for anyone who is looking to get 420 mail order delivered  to their home address for both medical and recreational use, here you can definitely have medical marijuana  sale online delivered to you at the comfort of your home at the very best choice with just a single click buy weed online now. Reliable mail order marijuana

    ReplyDelete
  25. The Arizona Medical Marijuana Act goes into effect on April 15, 2011. The Act permits a "qualifying patient" with a "debilitating medical condition" to obtain a registry identification card from the Arizona Department of Health Services (ADHS). Cardholders can obtain an allowable amount of marijuana from a registered non-profit medical marijuana dispensary and use the marijuana to treat or alleviate certain medical conditions. Buy 710 King pen Cartridges

    ReplyDelete
  26. The first state ever to legalize the use of marijuana for medical purposes was California. It has issued a Proposition 215, which is also referred to as the Compassionate Use Act of 1996. Since then, the state has undergone through a lot of things, including multiple Medical Marijuana Dispensary raids by the DEA. Buy Mario Carts

    ReplyDelete
  27. Are you tired of weeds in your garden? Are they holding your garden back? Weeds are the most common challenges that every gardener or landscaper has to face. We want weeds to stay out of our beautiful garden and landscapes. Although fighting with weeds is a year round job, fall and early spring is the best time to practice weed prevention. The best defense against weeds is your thick and healthy lawn. Here are few useful weed control measures that you can take to make your garden healthy and attractive. 420 mail order usa

    ReplyDelete
  28. Good content, hope you well and keep it up.
    property management

    ReplyDelete
  29. Over the past few years, the CBD market has been seeing a lot of customers. CBS is also called Cannabidiol Oil. Actually, this compound is extracted from cannabis. CBD has a number of medical benefits to offer. It is good for patients with epilepsy, arthritis, back pain, cancers, and AIDS, just to name a few. DreamWoRx Botanicals B2B CBD

    ReplyDelete
  30. The increase in activity during COVID-19 and the 420 season led Cresco Labs, the Chicago-based producer and retailer of cannabis, order weed online

    ReplyDelete
  31. 421 mail order at our website, it is possible to chill out realizing that the whole items are created by reliable agents and stick to the high quality criteria. About Healths Check out our listing to find the buy cannabis oil on the web that will meet up with all of your wants.About Healths

    ReplyDelete
  32. Thanks for the guide but, some browsers have adobe flash player blocked. There are few methods to unblock flash player on our blog.

    ReplyDelete
  33. Ingin bermain Ceme mudah dan nyaman? caranya adalah bermain ceme online terbaik saat ini di http://qiu9online.com/ceme-online-terpercaya-adalah-tempat-yang-tepat-dapat-uang/

    ReplyDelete
  34. Before you begin the training process you need to take sometime to analyze yourself. The first thing that you should do is takeout a pen and some paper and list the three adjectives that best describe your personality. Chihuahuas for sale near me

    ReplyDelete
  35. Pet shops and breeders make a huge amount of money during the winter holiday season. That's because people believe that puppies, kittens and exotic pets make great gifts. Just the thought of you, a loved one or close friend receiving a bundle of pet joy during the holiday time warms your heart. However, most people end up cooling off to the idea real fast once they discover all the work involved in caring for a new pet. how much are cavalier king charles spaniel

    ReplyDelete
  36. This web page is really a walk-through its the details you wished about this and didn’t know who need to. Glimpse here, and you’ll certainly discover it.
    420 mail order usa

    ReplyDelete
  37. Before 2016, medical marijuana dispensaries were regulated only at the local level by County and City governments. In 2015 and 2016, we now have some new laws that regulate the medical marijuana business in California. These laws including licensing laws that apply to both cannabis dispensaries and recreational marijuana businesses. Persons looking into the medical marijuana business and who want to obtain these new licenses should review this article for further details about what steps they need to take to obtain these important licenses. big chief carts

    ReplyDelete
  38. Welcome to Magic mushrooms center. Here you can buy magic mushrooms and stand the chance of 100% guaranteed delivery. Moreover, you can get the best quality magic mushrooms of different types. Our main motive is to prevent the hazards from buying shrooms from the street. We have the best supply of magic mushrooms in the market like Liberty caps, Psilocybe cyanescens, Psilocybe Mexicana,penis envy and many more. Feel free to contact us for more inquiries.Liberty caps mushrooms online

    ReplyDelete
  39. This is extremely fascinating substance! I have completely delighted in perusing your focuses and have reached the conclusion that you are right about a hefty portion of them. You are extraordinary.
    much obliged this is great web journal.Livrari flori cluj

    ReplyDelete
  40. Normally I do not read article on blogs, but I would like to say that this write-up very forced me to try and do it! Your writing style has been surprised me. Thanks, very nice post. flirt for free

    ReplyDelete
  41. Excellent Blog! I would like to thank for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well.Monster Truck Show

    ReplyDelete
  42. Your Number one Munchkin kitten breeder. We strive to be the best Munchkin kitten breeder and to provide all families who contact us in-search of Munchkin kitten with the best babies ever. All our kittens for sale are registered and come with health and registration papers. anonymous chat

    ReplyDelete
  43. Let’s read all these articles
    https://www.lokaeats.com/waffle-house-menu-price-usa/
    https://www.lokataste.com/madam-kwan-menu-price-malaysia

    ReplyDelete
  44. This is extremely fascinating substance! I have completely delighted in perusing your focuses and have reached the conclusion that you are right about a hefty portion of them. trincomalee beach sri lanka

    ReplyDelete
  45. Thanks for the sensible critique. Me and my neighbor were just preparing to do some research on this. We got a grab a book from our local library but I think I learned more from this post. I am very glad to see such great info being shared freely out there. Shopping Store Deals

    ReplyDelete
  46. There has been much talk over the years on how to revitalise the older part of the Pialba business district. I personally believe there is one fundamental problem that needs addressing. We need to have a suburb called Hervey Bay City which incorporates the CBD area. CBD Oil For Sleep

    ReplyDelete
  47. Wow! This can be one particular of the most useful blogs We’ve ever arrive across on this subject. Basically Magnificent. I’m also an expert in this topic so I can understand your hard work. Bargain Shopping

    ReplyDelete
  48. The goal of Williamson Caterers is to meet and exceed our clients’ expectations durham hill farm and make certain that our clients’ enjoy their event as much as their guests. Darren Wogman

    ReplyDelete
  49. This is a great article thanks for sharing this informative information. I will visit your blog regularly for some latest post. I will visit your blog regularly for Some latest post.Game

    ReplyDelete
  50. I am thankful to you for sharing this article here.It's a nice article, Which you have shared here . Your article is very informative and I really liked the way you expressed your views in this post.seo

    ReplyDelete
  51. There is a possibility that the plants will be washed later in the microwave oven, do not use staples, paper clips, or other metal objects. Sometimes additional information is required to provide complete differentiation, as well as special staining techniques. travel

    ReplyDelete
  52. I personally use them exclusively high-quality elements : you will notice these folks during:cosmetic beauty facial mask raw material

    ReplyDelete
  53. For by far most, this is a "sufficient" perspective on wellbeing. Feeling that way is an inevitable outcome. It implies that not beneficial is all that you can expect. Cape Verde Holidays

    ReplyDelete
  54. Nice post. I was checking constantly this blog and I am impressed! Extremely helpful information specially the last part I care for such info a lot. I was seeking this particular information for a very long time. Budapest flat

    ReplyDelete
  55. We’re an online shopping marketplace and we provide an affordable and seamless shopping experience. AllShopBiz offers shopping deals on the world’s largest selection of products and services. You can explore large range of products and product categories, as we provide you with the best prices across a wide-spread range of Electronics, Clothing and Apparels, Furniture etc. Looking for a website to purchase some electronic goods, but you don’t know where you can find a website where you can find everything related to electronics and more at a reasonable price?Shop Store

    ReplyDelete
  56. I am jovial you take pride in what you write. It makes you stand way out from many other writers that can not push high-quality content like you Monster Truck Show

    ReplyDelete
  57. Thanks for sharing amazing content in this article, keep adding more to answer different questions.
    It will keep readers happy.

    ReplyDelete
  58. Whats Taking place i’m new to this, I stumbled upon this I’ve found It absolutely helpful and it has aided me out loads. I am hoping to contribute & aid other customers like its aided me. Good job.United Arab Emirates

    ReplyDelete
  59. Thanks for your marvelous posting! I quite enjoyed reading it, you may be a great author.I will always bookmark your blog and will often come back later in life. I want to encourage continue your great work, have a nice afternoon! For more visit this site

    ReplyDelete
  60. Answer Diary
    Amir Articles
    Coins Reader
    Readers Country

    https://answerdiary.com/
    https://amirarticles.com/
    https://coinsreader.com/
    https://readerscountry.com/

    -------------------------------------------
    https://zonediary.com/
    https://modsdiary.com/
    https://trendswallet.com/
    https://crucialpets.com/
    https://firsthealthdiary.com/
    https://firsttraveldiary.com/


    Zone Diary
    Mods Diary
    Trends Wallet
    Crucial Pets
    First Health Diary
    First Travel Diary

    ReplyDelete
  61. An fascinating discussion is value I think that it best to write extra on this matter, it won’t be a taboo topic however generally people are not enough to talk on such topics. To the next. การ์ดแต่งงาน

    ReplyDelete
  62. You completed a few fine points there. I did a search on the subject and found nearly all persons will go along with with your blog.check this url

    ReplyDelete
  63. Beautiful a great post. I fair faltered upon your web journal and needed to say that I have truly delighted in perusing your web journal posts. game light

    ReplyDelete
  64. Hi,The very next time I read a blog, I hope that it won’t disappoint me as much as this one. After all, I know it was my choice to read, however I genuinely thought you’d have something useful to talk about. All I hear is a bunch of whining about something that you can fix if you weren’t too busy searching for attention. Monster Truck Show

    ReplyDelete
  65. This post is good enough to make somebody understand this amazing thing, and I’m sure everyone will appreciate this interesting things.ฤกษ์แต่งงาน

    ReplyDelete
  66. No doubt this is an excellent post I got a lot of knowledge after reading good luck. Theme of blog is excellent there is almost everything to read, Brilliant post.Benidorm Fancy Dress

    ReplyDelete
  67. Thank you for another informative web site. Where else could I get that type of information written in such a perfect way? I have a project that I am just now working on, and I’ve been on the look out for such information.gaminglight

    ReplyDelete
  68. I am a fan of reading to add insight to information. Thank you for this great blog. this is here, the few months I am visiting and following you. What I really like about you is that your writing style. Budapest property

    ReplyDelete
  69. Wow, cool post. I’d like to write like this too – taking time and real hard work to make a great article… but I put things off too much and never seem to get started. Himalayan Persian Cat

    ReplyDelete
  70. Thank you for another informative web site. Where else could I get that type of information written in such a perfect way? I have a project that I am just now working on, and I’ve been on the look out for such information. Budapest apartments

    ReplyDelete
  71. Excellent post. I was checking continuously this blog and I am impressed! Extremely helpful information specifically the last part :) I care for such information much. I was seeking this particular
    info for a long time. Thank you and best of luck.

    my blog post === 오피사이트
    (jk)

    ReplyDelete
  72. Hi, Christmas presents from this brand that are available for purchase today. If you have yet to buy a Christmas present from Atlas Games, then you should definitely do so as soon as possible. When you do so, you can rest assured that you will find the right Christmas present for the one that you are getting the present for and with the right amount of thought and care. Solar Investing

    ReplyDelete
  73. Итс лике ёу реад мы минд! Ёу сеем то кнощ со муч абоут тхис, лике ёу щроте тхе боок ин ит ор сометхинг. И тхинк тхат ёу цан до щитх а фещ пицс то дриве тхе мессаге хоме а бит, бут отхер тхан тхат, тхис ис греат блог. А греат реад. И’лл цертаинлы бе бацк.

    ReplyDelete
  74. I have been watching every single episode of this show and it has been quite impressing and entertaining for the first time. Now I have been really interested to see the new episode which is here.Female Muslim Personal Trainer

    ReplyDelete
  75. Exciting post and thank you for sharing. There are things here that I didn’t think some time as of late. Because of cool such a position, to the point that is to a great degree carefully taken, we will talk a huge amount of colleagues about it. Muslim Personal Trainer

    ReplyDelete
  76. These days, CBD oil business is on the rise. In fact, the market is going to enjoy rapid growth as there is a lot of demand for the product. Some people don't know the source of the oil. Actually, CBD is short for Cannabidiol. Basically, the oil is extracted from a plant and is useful for people with stress, arthritis and many other conditions. If you want a few solid strategies to help you start and grow your business by selling this oil, you may want to read this guide. FACE WASH

    ReplyDelete
  77. buy-xanax-2mg-online
    buy-2-a1mp-online
    https://lessonpharma.com/product/buy-2-a1mp-online/
    buy-xanax-2mg-online
    https://lessonpharma.com/product/buy-cociane-online/
    https://lessonpharma.com/product/buy-xanax-2mg-online/
    https://lessonpharma.com/product/buy-oxycontin-80mg/
    https://lessonpharma.com/product/buy-roxicodone-online/
    https://lessonpharma.com/product/buy-adipex-online/
    / buy-tramadol-online


    Are you looking for an easy and simple way to purchase medications an and get it delivered directly to your door?We guarantee only the best quality products,More to that we give advice and are customer services is always one 24/7 for are clients
    https://lessonpharma.com/store/
    https://lessonpharma.com/product/buy-oxycodone-online/

    Email: trusted@lessonpharma.com
    text/Whatapp :+1(323)546-9732
    kik ID: jamespope22
    Wickr id: romeopope

    ReplyDelete
  78. I am really loving the theme/design of your web site. Do you ever run into any browser compatibility problems? A few of my blog readers have complained about my website not working correctly in Explorer but looks great in Chrome. Do you have any tips to help fix this issue. unlock youtube

    ReplyDelete
  79. I really appreciate the kind of topics you post here. Thanks for sharing us a great information that is actually helpful. SSD Cheap Web Hosting

    ReplyDelete
  80. I am really loving the theme/design of your web site. Do you ever run into any browser compatibility problems?I faced such issue on my website
    winnipups can you take a look over it and let me know

    ReplyDelete
  81. Shipping can be expensive. With this guide, we offer tips and solutions for saving money in all aspects of shipping, order fulfillment, and packaging.group insurance

    ReplyDelete