webpage

Getting Webpage Title, Img, Metadata info from Linux Terminal

泄露秘密 提交于 2019-12-13 06:26:18
问题 is there any way or any tools that I could use to get from a SH script, a webpage title, metadata such as descriptions, maybe a little screenshot of the webpage or anything like that? Thanks in advance! 回答1: you could use curl or wget to get the webpage, and then pipe it to sed to get the contents of various tags. It's kludgy as , but that's kinda what you're going to get if you're doing this stuff with a shell script. eg wget http://example.com -O - | grep \<title\>|sed "s/\<title\>\([^<]*\)

Refresh Image in JSP/ Avoiding cache

爱⌒轻易说出口 提交于 2019-12-13 06:04:25
问题 I am working on web project where I have to generate image and display it on JSP page when it gets load. Now the problem is that I am have to use same image name and hence browser is using cached image always and not the new one. Display.jsp <html> <head> <script type="text/javascript"> updateImage(){ var img1 = document.getElementById("text"); img1.src="sun.png?time=".new Date().getTime(); } </script> </head> <body onload="updateImage()"> <form action="com.CheckName" method="get"> <input

How to download dynamic generated content from webpage?

让人想犯罪 __ 提交于 2019-12-13 05:41:25
问题 I'm trying to download some data from a webpage that is dynamically generated, so using wget doesn't work. The page is http://gaceta.diputados.gob.mx/SIL/Legislaturas/Listados.html I want to download the list shown for each of the options that can be selected in the field "Legislatura" once downloaded I can process the data in ruby. Just wanted to know what is the best way to download this, and if posible to select each of the options and download. 回答1: You can use the Web Inspector in Safari

Cannot make menubar dropdown hover properly

元气小坏坏 提交于 2019-12-13 04:32:57
问题 I have a menu bar which has 8 to 9 menus horizontally of different character length. Also, each and every menu has sub menus of different character length. All I want is - 1. all the menus should be across the page (should fill the html body width that i have decided) 2. all the sub menus should be drop down and will be of same width like as the parent menu width. All i can do is, i have stretched menu bar so that it can fill the html body width and they took symmetrical width. but i cannot

Pulling HTML from a Webpage in Java

為{幸葍}努か 提交于 2019-12-13 04:09:21
问题 I want to pull the entire HTML source code file from a website in Java (or Python or PHP if it is easier in those languages to display). I wish only to view the HTML and scan through it with a few methods- not edit or manipulate it in any way, and I really wish that I do not write it to a new file unless there is no other way. Are there any library classes or methods that do this? If not, is there any way of going about this? 回答1: In Java: URL url = new URL("http://stackoverflow.com");

How to call a page from another domain to my domain using ajax/javascript

删除回忆录丶 提交于 2019-12-13 02:34:13
问题 I would like to call and show a page from another domain to my domain using ajax/javascript. I would like to hide the original url of the page. (Example in the case of surveymoneky, I can load the survey page in my web site with out showing the surverymonkyes url.) How can I do it ? Thanks in advance.. Regards, Sunil 回答1: Due to the SOP (same origin policy) implemented in browsers, you can only retrieve information from another domain using Ajax if the other domain allows that by setting the

Page protection does not work correctly for the Administrator page

本秂侑毒 提交于 2019-12-12 22:22:39
问题 I posted a similar post of this whith a different code, but changed it a little now, and did not get an answers that I was hoping for (the answers did not help me much). I hope this is Ok, tell me if it is not. :) I have been trying to make a page protection for the Administrator page, and I can not get it to work. I am sure this would not have been a problem if I was not new to PHP coding, hehe. When a normal user with the type '0' is trying to access the administrator page, index_admin.php

Python: How do I parse HTML of a webpage that requires being logged in?

岁酱吖の 提交于 2019-12-12 18:15:54
问题 I'm trying to parse the HTML of a webpage that requires being logged in. I can get the HTML of a webpage using this script: from urllib2 import urlopen from BeautifulSoup import BeautifulSoup import re webpage = urlopen ('https://www.example.com') soup = BeautifulSoup (webpage) print soup #This would print the source of example.com But trying to get the source of a webpage that I'm logged into proves to be more difficult. I tried replacing the ('https://www.example.com') with ('https://user

How to adapt website to user's Screen Resolution?

99封情书 提交于 2019-12-12 15:15:16
问题 I'm designing my website by using a base of 1024x768 screen resolution. When you're looking at the website in the browser from a computer with a smaller/bigger screen resolution the website starts to deform. How can I adapt the website to user's screen resolution no matter what screen resolution the user have? I believe it's possible trough JavaScript or CSS, but not sure how... 回答1: The best way to tackle this issue is instead of using px use em or % ( percentage ). .container { width: 1000

Read data from webpage

时间秒杀一切 提交于 2019-12-12 12:33:24
问题 I am trying to read data from the given web page using Java. public class WebpageReader { public static void main(String[] args) throws IOException { String line = null, response; URL url = new URL("http://www.google.co.in/"); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); BufferedReader rd = new BufferedReader(new InputStreamReader(conn .getInputStream())); while (rd.readLine() != null) { line += rd.readLine(); } System.out.println(line); } } But I'm getting the