webpage

Download the entire webpage

你说的曾经没有我的故事 提交于 2019-12-04 19:27:08
There are ways to download an entire webpage, using HTMLEditorKit . However, I need to download an entire webpage which needs scrolling in order to load its entire content . This technology is achieved most commonly through JavaScript bundled with Ajax. Q.: Is there a way to trick the destined webpage, using only Java code , in order to download its full content? Q.2: If this is not possible only with Java, then is it possible in combination with JavaScript? Simple notice, what I wrote: public class PageDownload { public static void main(String[] args) throws Exception { String webUrl = "...";

Trying to get encoding from a webpage Python and BeautifulSoup

淺唱寂寞╮ 提交于 2019-12-04 19:24:26
Im trying to retrieve the charset from a webpage(this will change all the time). At the moment Im using beautifulSoup to parse the page and then extract the charset from the header. This was working fine until I ran into a site that had..... <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> My code up until now and which was working with other pages is: def get_encoding(soup): encod = soup.meta.get('charset') if encod == None: encod = soup.meta.get('content-type') if encod == None: encod = soup.meta.get('content') return encod Would anyone have a good idea about how to add to

Setting page load timeout in Selenium Python binding

夙愿已清 提交于 2019-12-04 17:37:34
I am writing a bot using Python with Selenium module.When I open a webpage with my bot, since the webpage contains too many external sources than dom, it takes a lot to get all of the page loaded. I used the explicit and implicit waits to eliminate this problem since I just wanted a specific element to be loaded and not all of the webpage, it didn't work. The problem is If i run the following statement: driver = webdriver.Firefox() driver.get('somewebpage') elm = WebDriverWait(driver, 5).until(ExpectedConditions.presence_of_element_located((By.ID, 'someelementID')) elm.click() It doesn't work

Differences: View Page Source vs. View in Firebug

老子叫甜甜 提交于 2019-12-04 15:18:50
When I view the page source of a page (like this for example: http://my.sa.ucsb.edu/public/curriculum/coursesearch.aspx ) there's not very much code/info in it. On that linked page, for instance, none of the class info is shown in the page source. BUT: when I view it in firebug, I can see a lot more of the html information. For instance, I can see all of the class info, in tables. Why is this? How can I access the full (firebug html)? Can I do it in php/javascript? This is the order in which stuff happens: PHP generates HTML Browser loads HTML JavaScript manipulate loaded HTML Why is this? The

JS not running first time HTML page loads

对着背影说爱祢 提交于 2019-12-04 15:15:00
The javascript function does not run when the HTML page loads for the first time. However, if I do a page refresh, the script runs just fine. Description : My index page has a button which points to a showdata HTML page. The problem is that when I click the button in the index page, I can see (in the URL) that the showdata.html page is loaded but the JS code does not run (as I cannot see any alerts). However, if I do a page refresh or hit the URL manually, the JS runs fine and I can see the alert statements. Tried this on Chrome and Firefox and same results at both the places. If I am not

How to translate into other languages my web page?

岁酱吖の 提交于 2019-12-04 13:47:55
问题 How can I translate my web pages? Actually what technology or what scripting-if require- should be used? For info; I have all translated text. But I do not want to create something like clone site for other language. I used just javascript -including jquery . 回答1: Just using JavaScript... <script type="text/javascript"> // JSON-formatted, potentially read from a database var article = { title: { en_US: "Article Title", fr_FR: "Titre de l\'Article" }, content: { en_US: "Content of the Article.

How to disable copy and cut in TextBox?

耗尽温柔 提交于 2019-12-04 12:33:59
问题 In my webpage I want to disable copy and cut option in context menu on textbox. 回答1: <asp:TextBox ID="TextBox1" runat="server" oncopy="return false"> </asp:TextBox> 回答2: I'm new here. This is my first post and I hope it will help. Try this one: <asp:TextBox ID="someId" runat="server" oncopy="return false" onpaste="return false" oncut="return false" ondelete="return false"></asp:TextBox> It will work for copy, paste, cut, and delete on most of the input controls. 回答3: You can also add a

Detecting and accessing a usb device from within a webbrowser -i.e using a plugin

不打扰是莪最后的温柔 提交于 2019-12-04 10:42:07
问题 Is it possible through a plugin - activeX, Java or Flex to write a brower plugin that is able to detect an read a data stream from a USB device channel. I have done some research but have not found an answer. http://support.microsoft.com/kb/832678 http://www.vsj.co.uk/articles/display.asp?id=600 Detect USB drive and his name http://bytes.com/groups/net-vb/379899-detect-usb-drive-his-name Can JAVA be leveraged within embedded Javascript to access the USB port? http://p2p.wrox.com/topic.asp

Easiest way to launch webpage in android with an icon

亡梦爱人 提交于 2019-12-04 08:18:10
问题 We have a website that offers an e-mail service. We would like to create a fully fledged app for this but cannot afford this right now. In the mean time it would be great if we could give users an icon on their phones that will take them to a page formatted for mobile on the internet. So what I'd like to know is how can we get an icon on an android users phone that will simply launch a web link in a browser- does this have to be an app, is there an easier way, or am I over estimating how

I want an auto hard refresh, not a simple auto refresh on my webpages

余生长醉 提交于 2019-12-04 08:04:43
I know I can do a simple auto-refresh on some of my webpages (for example, the Home page of my site) by inserting a meta tag like <meta http-equiv="refresh" content="600"> But after doing this I'm getting really long page duration and session duration . This is not realistic, and I think that the refresh does not "reset" the page duration counter, which I think should happen. I guess this could be done with a hard refresh (Ctrl-F5 in Windows, Option+R in MacOSX), but I don't know if it is possible to force the refresh to be a hard refresh ... or if this kind of refresh would serve to my