title

How does PhpQuery work? Trying to get the value of <title> tag

这一生的挚爱 提交于 2019-12-05 16:14:40
I'm new to phpQuery . I need to achieve the simple task of getting the content of the HTML TITLE tag of a webpage. In this case I'm trying to get the title content of "Yahoo!" that should be "Yahoo!". I'm doing this with phpQuery, but it is now working // Testing phpQuery $result = phpQuery::newDocumentFile($scraps['Scrap_yahoo']->getPage('http://www.yahoo.com','','off')) ->find('title'); echo $result->text(); Can someone give me a clue on how to achieve this? Best Regards, mario I think the problem might be your phpQuery invocation with ::newDocumentFile() . This function needs a filename

jQuery ui dialog image for the title

*爱你&永不变心* 提交于 2019-12-05 12:06:45
Is it possible when specifying a jQuery UI dialog box, to have an image be placed for my title instead of just plain text? Thanks You can provide any HTML as the title option, like this: $("#dialog").dialog({ title: '<img src="myImage.jpg" />' });​​​​​​​​​​​ You can see an example in action here Or, as another demo to annoy the hell out of your users, you could do this : $("<div />").dialog({ title: '<marquee>Hello</marquee>' });​ 来源: https://stackoverflow.com/questions/3543532/jquery-ui-dialog-image-for-the-title

python——爬取中国研究生信息网调剂信息

耗尽温柔 提交于 2019-12-05 12:04:43
代码如下: from DrawStu.DrawStu import DrawStu; import time; import io import sys sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='gb18030') #初始化class 得到对象 draw=DrawStu(); if __name__ == '__main__': print('爬取研究生调剂信息'); size=draw.get_page_size(); print(size) for x in range(size): start=x*50; print(start); #print(); created_url='https://yz.chsi.com.cn/kyzx/tjxx/?start='+str(start); draw.draw_base_list(created_url); pass import sqlite3; class DB(object): """数据库访问方法的实现""" """初始化api 产生数据操作的对象 conect 操作的游标""" def __init__(self): self.conn={}; self.cus={}; #初始化数据库链接的api #1产生数据库链接对象 self.conn

Send UIWebView title to UINavigationBar

不想你离开。 提交于 2019-12-05 12:04:10
问题 I am trying to send the UIWebView page Title to UINavigationBar. I would also like it if a user clicks on a link the UINavigationBar shows a back button but if on the home page hide the back button. 回答1: to retrieve the title page into an UIWebView you can use it: myNavigationBar.title = [myWebView stringByEvaluatingJavaScriptFromString:@"document.title"]; If you want to go back you can do that: if ([myWebView canGoBack]){ [myWebView goBack]; } To know if the user has loaded a new page you

Wpf window title from static resource

旧城冷巷雨未停 提交于 2019-12-05 11:07:52
I am using resource dictionarys for localizations, I have this code in wpf: <Window x:Class="RWIS_WPF.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="RWIS" Height="500" Width="800" MinHeight="500" MinWidth="800"> <Window.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Localizations/Dictionary.EN.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Window.Resources> My problem is, that I want to localize window title using

How would I replace the meta title, keywords and description on the ajax loaded html document?

久未见 提交于 2019-12-05 10:26:51
How would I replace the meta title and description on the document with the meta title and description from an incoming html document on an ajax call?? I am calling new content from the #content div on an adjacent html document. What I want to happen is when the new content loads I want to replace the main documents title (and description and keywords... might as well since im tooling around up there anyway) with the meta title in the html file that is being loaded. I have thought about using replace(); or match(); but I just wanted to find out the best way. here is the script: // JavaScript

好程序员web前端教程分享前端javascript练习题三

怎甘沉沦 提交于 2019-12-05 07:28:58
好程序员web前端教程分享前端javascript练习题三,cookie 一周内免登录 样式代码: <form action=""> 姓名:<input type="text" id="usename"/><br /> 密码:<input type="text" i="mima"/><br /> 一周内免登陆<input type="checkbox" /> <input type="button" id="btn" value="登录"/><br /></form> js功能代码: var input=document.getElementsByTagName("input"); if(getCookie("usename")){ //判端cookie是否有数据 input[0].value=getCookie("usename"); input[1].value=getCookie("password"); input[2].checked=true; } input[3].onclick=function(){ if(input[2].checked){ setCookie("usename",input[0].value,1); setCookie("password",input[1].value,1); }else{ removeCookie("usename");

如何把一个大的对象,转成若干个小对象,然后在放到数组中

ぃ、小莉子 提交于 2019-12-05 06:29:50
我用了两种方法来解决它,一种较为复杂不提倡,一种较为简单 1.复杂的 (不提倡) var obj = {A:1,B:2,C:3} var Barr = Object.entries(obj) //对象自身可枚举属性的键值对数组 var arr = [] for (var i = 0; i < Barr.length; i++) { var obj = {} obj.num = i+1 obj.title = Barr[i][0] obj.con = Barr[i][1] arr.push(obj) } console.log(arr) //[ {num: 1, title: "A", con: 1},{num: 2, title: "B", con: 2},{num: 3, title: "C", con: 3}] 2.简单方法(for ... in 遍历对象) var obj = { A: 1, B: 2, C: 3 } var arr = []; //创建一个数组 for (var key in obj) { var temp = {}; //创建临时对象 temp.name = key; //存储对象的Key为name temp.value = obj[key]; //存储value arr.push(temp); } console.log(arr) //[ {num: 1

<f:selectItems> JSF tag custom tooltip attribute

烈酒焚心 提交于 2019-12-05 02:28:08
Is it possible to add a "title" attribute to the tag in JSF, for example: <f:selectItems value="#{foo.fooList}" title="{foo.fooDescription}"/> Generated HTML: <select> <option value="foo1" title="description1">foo ex1</option> <option value="foo2" title="description2">foo ex2</option> </select> McDowell I don't have an elegant solution, but it can be done. I'm assuming JSF 2+ & Facelets VDL. For a managed bean Foo : @ManagedBean @RequestScoped public class Foo { private List<SelectItem> fooList = Arrays.asList( new SelectItem("value1", "label1", "description1"), new SelectItem("value2",

Adding title in contentplaceholder adds second empty title tag

谁说我不能喝 提交于 2019-12-05 01:23:54
问题 My master page has a contentplaceholder in the head tag. Because I want my page's title to represent the function of the current page and because I want the title to be translated in the user's language I have added a title tag in the page's head's contentplaceholder. All jolly and good except that now there appears a second, empty title tag that off course isn't valid. Any ideas how to solve this? 回答1: I ran into the same problem and found a solution that seems to work. It's pretty hacky but