webpage

iphone uiwebview download complete page with CSS and Images

本小妞迷上赌 提交于 2019-11-27 04:34:58
问题 In my app there's a uiwebview that loads a url. I am using the following line to save the HTML of the page loaded locally to be able to view it offline. NSString* html=[webView stringByEvaluatingJavaScriptFromString:@"document.getElementsByTagName('html')[0].innerHTML"] The problem is only the HTML of the document that gets saved, I want to save also the images and the CSS along with the HTML so that the user see the page as if he is online. just like "save web page complete" or something

Getting all visible text from a webpage using Selenium

空扰寡人 提交于 2019-11-27 04:01:14
I've been googling this all day with out finding the answer, so apologies in advance if this is already answered. I'm trying to get all visible text from a large number of different websites. The reason is that I want to process the text to eventually categorize the websites. After a couple of days of research, I decided that Selenium was my best chance. I've found a way to grab all the text, with Selenium, unfortunately the same text is being grabbed multiple times: from selenium import webdriver import codecs filen = codecs.open('outoput.txt', encoding='utf-8', mode='w+') driver = webdriver

Retrieve image from FTP to webpage

一个人想着一个人 提交于 2019-11-27 02:11:10
I have a folder in my ftp server which contains several images. I'm trying to access and show these images in a webpage like <img src="ftp://my_ftp_ip_address/Images/imagename.jpg"/> But it asks for an FTP username and password. How can I achieve this? Also is it possible to do the same using Java? With the latest versions of web browsers ( Chrome 59 , Firefox 61 ), you cannot even use ftp:// URL to retrieve an image. And it was never a good solution anyway. The correct solution is to route the image through your webserver, hiding away not only the credentials, but also the original source of

Connect to URL and dump webpage in Groovy

独自空忆成欢 提交于 2019-11-27 01:45:36
问题 I would like to open a webpage from groovy, dump the specified webpage and eventually dump the webpage behind an anchor tag. Does anybody has some sample code for this? 回答1: This is a good example http://docs.codehaus.org/display/GROOVY/Simple+file+download+from+URL Basically you want to do something like def data = new URL(feedUrl).getText() 回答2: here is a variation println 'http://www.google.com'.toURL().text 来源: https://stackoverflow.com/questions/943873/connect-to-url-and-dump-webpage-in

Push changes to a webpage without refreshing

不羁岁月 提交于 2019-11-27 01:23:15
问题 I know that we can do this by polling for changes in regular intervals. And this can be achieved by AJAX (for example using jQuery.load() along with setInterval() ). But I want to know that are there other methods to do this? Other less costly methods or more efficient methods? What logic an awesome chat client follows? As as soon as you start typing, the other end gets to know that you are typing. What mechanism do we follow here on stackoverflow to update the upvote count or to show that an

Bootstrap 3 - jumbotron background image effect

泪湿孤枕 提交于 2019-11-26 23:47:38
问题 Hi I'm trying to build a site with a jumbotron with a background image, which in itself is not hard: HTML: <div class="jumbotron"> ... </div> CSS: (which lies in my custom css file and is loaded after all over css). .jumbotron { margin-bottom: 0px; background-image: url(../img/jumbotronbackground.jpg); background-position: 0% 25%; background-size: cover; background-repeat: no-repeat; color: white; text-shadow: black 0.3em 0.3em 0.3em; } Now this creates a jumbotron with a background image,

javascript to get paragraph of selected text in web page

落爺英雄遲暮 提交于 2019-11-26 22:02:46
After highlighting text, I would like to obtain the paragraph in which the selected text resides. var select = window._content.document.getSelection(); Any pointers please? cletus This is actually rather hard to do because you have to consider six cases: The selection is not within a paragraph (easy); The entire selection is within one paragraph (easy); The entire selection crosses one or more sibling paragraphs (harder); The selection starts or ends in an element not within a paragraph (harder); The paragraphs spanned are at different levels eg one is within a list item while two others are

How can I take a screenshot/image of a website using Python?

流过昼夜 提交于 2019-11-26 21:19:52
What I want to achieve is to get a website screenshot from any website in python. Env: Linux On the Mac, there's webkit2png and on Linux+KDE, you can use khtml2png . I've tried the former and it works quite well, and heard of the latter being put to use. I recently came across QtWebKit which claims to be cross platform (Qt rolled WebKit into their library, I guess). But I've never tried it, so I can't tell you much more. The QtWebKit links shows how to access from Python. You should be able to at least use subprocess to do the same with the others. Here is a simple solution using webkit: http:

jQuery web page height

爱⌒轻易说出口 提交于 2019-11-26 17:59:12
问题 Let's say that a web page is twice the height of the browser window (thus there's a scroll bar). How do I retrieve the height of the web page in jQuery? 回答1: $(window).height(); // returns height of browser viewport $(document).height(); // returns height of HTML document 回答2: You could use the height() of the document. $(document).height(); 回答3: This can work also. $('body').height(); 来源: https://stackoverflow.com/questions/1304378/jquery-web-page-height

Is it possible to display the HTML Code of a webpage in a batch file?

梦想的初衷 提交于 2019-11-26 17:22:02
问题 For my new program I want to echo the code of a webpage. I searched on google and Stack Overflow but didn´t found something like this. I do not want to use external programs like URL2FILE or something like this. 回答1: This code is from a previous question that only needed to do the query to the server (linked in comments) with the "display" of the page source code added. @if (@This==@IsBatch) @then @echo off rem **** batch zone ********************************************************* setlocal