I've an idea and want to implement it.
But I'm not sure if it's gonna work. So, wanted to get your inputs.
I would like to take screenshots of a url.
Say, when I open a web-site www.espncricinfo.com , I would like to take screenshot of that page and save locally. This saved image can be converted to GIF later on.
Can this be achieved through python ? Any suggestions/inputs to make it ?
Updated
And also is it possible to capture screenshot in headless-browser ?
Any possibilities to launch the browser in headless mode (non-GUI) and then take the screenshot of particular area of web-page ?
To take a screenshot using python:
import pyscreenshot as ImageGrab
im = ImageGrab.grab()
im.save('path/to/image/folder/image_name.png')
im.show()
Yes and no, if you send a request with urllib you will get the HTML in return, which is step one to displaying a webpage. But you have to build that webpage from that with a browser engine, otherwise all you will see is a bunch of text.
There are some python libraries that can do this, such as pywebkitgtk, but those are probably not going to give you the best experience and support.
Another thing you could try is to use crod and firefox/chrome/whatever and then use python to automate the process.
Oh, and by the way, I strongly recommend upgrading to python3
I know it is a bit to late now, but just saw this question and in case anyone else is looking for a mighty tool, to do screenshots and also use headless browsers with python... I just want to recommend to look more deeply into https://www.seleniumhq.org/. There are many tutorials on youtube available. However, this is IMHO the most accurate framework to execute your task, IMHO. To make screenshots, you can then define the screen resolution etc.
Related
Sorry if the title somewhat ambiguous.
I'm buliding an app that recieve an URL then return the final HTML code (and save it for caching), after Ajax and other js feature executed (something like Phantomjs).
My language can call C++ code, so I think it would be nice if I can buid and use Blink/Webkit libary directly.
The issue is both Blink/Webkit document is too big.
UPDATE 1: Which API (Blink has many APIlayer) or a particular class I need to look at?
Do you know any example or tutorial I should look at?
Or any alternative simpler libary?
Thanks
Finally Chromium project have headless API in development with very good example which can be build using ninja, more information in their project at https://chromium.googlesource.com/chromium/src/+/master/headless/
A video from BlinkOn https://www.youtube.com/watch?v=GivjumRiZ8c&t=838s
Hi I want to use Tab Activity(My Tab View must be at bottom) and android version 4.0 or later told that tabactivity is deprecated. so it must be a better way than it. but I could not find properly. some tutorials gave me advise to use Fragments but really I don't know anything about it. so please suggest me best tutorial or sample code for Fragments Or other best alternative way.
Thanks!
One suggestion is to use the Sherlock ActionBar. Inside the package there are good sample projects about Fragments, ActionBar, Navigation with tabs! I recommend ActionBarSherlock!
It also is 2.x compatible!!!
here is a link from android developer site,
http://developer.android.com/reference/android/app/TabActivity.html
and a tutorial,
http://maxalley.wordpress.com/2013/05/18/android-creating-a-tab-layout-with-fragmenttabhost-and-fragments/
Just by following above links you can create i easily.
I followed this tutorial to build a component. Everything works as expected. Now I am confused on how to add an edit feature to the frontend. A uses (with appropriate rights) should be able to click an edit link and edit the data displayed by the component as well as add new data. Just like in the backend.
I have the feeling that I miss something obvious, but I couldn't get my code to work. I thouhgt, I could just replicate the backend code, but with no success.
Is there a tutorial or other hint you could give me?
Thanks
Sascha
I was right: I missed something obvious, because it's all there.
Look at this tutorial. It guides you through the process of integrating an editor to the frontend. But it also shows
how to display an edit form
and
save the data.
Best regards
Sascha
I've created a Django site that uses Bootstrap from Twitter. I've tested the site on the latest versions of Chrome, FireFox and Safari. It looks really nice. And then we have Internet Explorer (play failure music... wonk, wonk, woooonk). It seems to work ok, but it doesn't look near as nice (e.g. no rounded corners, etc). What I would like is to detect IE and then redirect them to a page that tells them that IE users may experience issues and that it is strongly recommended to use a more-compliant browser. But, unfortunately, I can't force them to not use IE. So, I need to add a flag saying that they've been show the page. Does anyone know of an app/middleware for doing something like this? I've done some googling, but really haven't found anything.
I don't think it would be terribly hard to write, but I would rather not re-invent the wheel.
Version information: Django 1.3.1; Bootstrap 2.0.2 and jQuery 1.7.2
If there's nothing at http://djangosnippets.org that does this (and I doubt there is, TBH), write it - because like you say, it's not hard - and contribute it
I know some javascript, html and css. However, i have no idea how could they make some website like http://apple.com/mac .
When I look at the source code of that sites, it looks like being generated by some program/ IDE. I guess people doesn't write all the code by their own using notepad in this case?
Can you suggest how people usually do (what steps/ tools/ IDE...) in order to start making a website like apple.com/mac ?
If you are an amateur website developer, I suggest using Dreamweaver as its WYSIWYG editor and also HTML5 / CSS3 support is great. If you want to stay just code editing, I'd advise Aptana Studio 3, again great code support. As for creating a site like Apple, it's a bit specific. Check out sites like http://net.tutsplus.com/ for tutorials on how to make sites.
How does the code look generated? Some JS is compressed - check out http://developer.yahoo.com/yui/compressor/ for an example.
To make sure you start off on the right end of the website developer spectrum check out:
http://html5boilerplate.com/
http://css3pie.com/
http://www.modernizr.com/
Also:
http://jquery.com
http://lesscss.org/
I'm missing out loads more here, there is so much to know. Don't focus on making a site like Apples, it sucks.
Well, first go yo the webpage!
Then right click and click view page source. Then type Control-A then type Control-C then put the code into your code then it will look like it (If you want to edit it change the code) Then you will have a webpage looking like the apple/mac page!