使用绝对定位来解决问题(Getting around using Absolute Positioning)
嘿,所有的,我有一个形象,我绝对定位,它在Firefox上完美的工作,但在Safari浏览器完全不同的地方,是否有任何其他方式将其放置在我想要的位置(在另一个图像顶部),而不使用绝对定位。 我已经尝试过保证金和填充,这是行不通的
Hey all, I have a image I am absolutely positioning and it works perfect on firefox, but in a totally different spot on safari, Is there any other way to position it where I want(on top of another image) without using absolute positioning. I have already tried margin and padding and that does not work
原文:https://stackoverflow.com/questions/1522575
更新时间:2022-11-07 21:11
最满意答案
使用html_nodes()而不是html_node()
library(XML) library(rvest) match <- "https://www.fotball.no/fotballdata/kamp/?fiksId=6616922" WSm <- read_html(match) Players <- WSm %>% html_nodes(".player-name") %>% html_attr("href") %>% as.character() Players > library(XML) > library(rvest) Loading required package: xml2 Attaching package: ‘rvest’ The following object is masked from ‘package:XML’: xml > match <- "https://www.fotball.no/fotballdata/kamp/?fiksId=6616922" > WSm <- read_html(match) > Players <- WSm %>% html_nodes(".player-name") %>% html_attr("href") %>% as.character() > Players [1] "/fotballdata/person/profil/?fiksId=2820074" "/fotballdata/person/profil/?fiksId=2775969" [3] "/fotballdata/person/profil/?fiksId=2774767" "/fotballdata/person/profil/?fiksId=2820044" [5] "/fotballdata/person/profil/?fiksId=2820232" "/fotballdata/person/profil/?fiksId=2820027" [7] "/fotballdata/person/profil/?fiksId=2820034" "/fotballdata/person/profil/?fiksId=2799892" [9] "/fotballdata/person/profil/?fiksId=2820237" "/fotballdata/person/profil/?fiksId=2799883" [11] "/fotballdata/person/profil/?fiksId=2847997" "/fotballdata/person/profil/?fiksId=2830200" [13] "/fotballdata/person/profil/?fiksId=2820235" "/fotballdata/person/profil/?fiksId=2779315" [15] "/fotballdata/person/profil/?fiksId=2820241" "/fotballdata/person/profil/?fiksId=2799908" [17] "/fotballdata/person/profil/?fiksId=2820240" "/fotballdata/person/profil/?fiksId=2860570" [19] "/fotballdata/person/profil/?fiksId=2795482" "/fotballdata/person/profil/?fiksId=2764974" [21] "/fotballdata/person/profil/?fiksId=2795481" "/fotballdata/person/profil/?fiksId=2794122" [23] "/fotballdata/person/profil/?fiksId=2852202" "/fotballdata/person/profil/?fiksId=2863826" [25] "/fotballdata/person/profil/?fiksId=2811850" "/fotballdata/person/profil/?fiksId=2863824" [27] "/fotballdata/person/profil/?fiksId=2800983" "/fotballdata/person/profil/?fiksId=2867153" [29] "/fotballdata/person/profil/?fiksId=2811916" "/fotballdata/person/profil/?fiksId=2780695" [31] "/fotballdata/person/profil/?fiksId=2811908" "/fotballdata/person/profil/?fiksId=2980432" [33] "/fotballdata/person/profil/?fiksId=2904191" "/fotballdata/person/profil/?fiksId=2806897" [35] "/fotballdata/person/profil/?fiksId=2794123"
Use html_nodes() not html_node()
library(XML) library(rvest) match <- "https://www.fotball.no/fotballdata/kamp/?fiksId=6616922" WSm <- read_html(match) Players <- WSm %>% html_nodes(".player-name") %>% html_attr("href") %>% as.character() Players > library(XML) > library(rvest) Loading required package: xml2 Attaching package: ‘rvest’ The following object is masked from ‘package:XML’: xml > match <- "https://www.fotball.no/fotballdata/kamp/?fiksId=6616922" > WSm <- read_html(match) > Players <- WSm %>% html_nodes(".player-name") %>% html_attr("href") %>% as.character() > Players [1] "/fotballdata/person/profil/?fiksId=2820074" "/fotballdata/person/profil/?fiksId=2775969" [3] "/fotballdata/person/profil/?fiksId=2774767" "/fotballdata/person/profil/?fiksId=2820044" [5] "/fotballdata/person/profil/?fiksId=2820232" "/fotballdata/person/profil/?fiksId=2820027" [7] "/fotballdata/person/profil/?fiksId=2820034" "/fotballdata/person/profil/?fiksId=2799892" [9] "/fotballdata/person/profil/?fiksId=2820237" "/fotballdata/person/profil/?fiksId=2799883" [11] "/fotballdata/person/profil/?fiksId=2847997" "/fotballdata/person/profil/?fiksId=2830200" [13] "/fotballdata/person/profil/?fiksId=2820235" "/fotballdata/person/profil/?fiksId=2779315" [15] "/fotballdata/person/profil/?fiksId=2820241" "/fotballdata/person/profil/?fiksId=2799908" [17] "/fotballdata/person/profil/?fiksId=2820240" "/fotballdata/person/profil/?fiksId=2860570" [19] "/fotballdata/person/profil/?fiksId=2795482" "/fotballdata/person/profil/?fiksId=2764974" [21] "/fotballdata/person/profil/?fiksId=2795481" "/fotballdata/person/profil/?fiksId=2794122" [23] "/fotballdata/person/profil/?fiksId=2852202" "/fotballdata/person/profil/?fiksId=2863826" [25] "/fotballdata/person/profil/?fiksId=2811850" "/fotballdata/person/profil/?fiksId=2863824" [27] "/fotballdata/person/profil/?fiksId=2800983" "/fotballdata/person/profil/?fiksId=2867153" [29] "/fotballdata/person/profil/?fiksId=2811916" "/fotballdata/person/profil/?fiksId=2780695" [31] "/fotballdata/person/profil/?fiksId=2811908" "/fotballdata/person/profil/?fiksId=2980432" [33] "/fotballdata/person/profil/?fiksId=2904191" "/fotballdata/person/profil/?fiksId=2806897" [35] "/fotballdata/person/profil/?fiksId=2794123"
相关问答
更多-
你可以使用library(stringr) text <- "ALBANYÃ, OFFÃ, REBOUND BY" library(stringr) str_replace_all(text, "Ã,Â", "") #> [1] "ALBANY OFF REBOUND BY" 或者使用gsub : gsub("Ã,Â","",text) #> [1] "ALBANY OFF REBOUND BY" 但是,我认为这首先是一个编码问题。 此外, gsub或str_replace_all结果可能 ...
-
好吧有些事情让这有点复杂。 我使用不同的方法进行webscraping,但那里的代码可以帮助你 library(RCurl) library(XML) library(stringr) library(tidyr) url<-"http://www.wettportal.com/quotenvergleich/valuebets/" url2<-getURL(url) parsed<-htmlParse(url2,encoding = "UTF-8") info1<-xpathSApply(parsed, ...
-
你可以尝试unique unique(data) You can try unique unique(data)
-
这是你想要的输出吗? require(RCurl); require(XML) asdf <- htmlParse("http://www.hockeyfights.com/fightlog/1") asdf.asdf <- readHTMLTable(asdf) 首先,制作每个玩家的桌子以及他们曾经参加的战斗计数...... # get variable with player names one <- as.character(na.omit(asdf.asdf[[1]]$V3)) # get cou ...
-
使用R刮擦,只在列表中抓取第一个实例[关闭](Scraping with R, only first instance being scraped in the list [closed])[2021-09-24]
使用html_nodes()而不是html_node() library(XML) library(rvest) match <- "https://www.fotball.no/fotballdata/kamp/?fiksId=6616922" WSm <- read_html(match) Players <- WSm %>% html_nodes(".player-name") %>% html_attr("href") %>% as.character() Players > library(XM ... -
计算列表中第一个关键字实例,R中没有重复计数(Count 1st instance of keyword in list with no duplicate counts in R)[2021-11-25]
在这个例子中, grepl并不是绝对必要的,来自基数R的grepl就足够了。 也就是说,如果您更喜欢包函数,请使用str_detect而不是grepl (正如@ Chi-Pak在评论中指出的那样) library(stringr) words <- c("decomposed", "no diagnosis","decomposition","autolysed","maggots", "poor body", "poor","not suitable", "not possibl ... -
好的,我无法发表评论,因为我没有WikiItem的定义,所以无法测试您的代码。 但是让迭代这个回复,好吗? 你能看看这段代码得到了什么吗? class Spider(scrapy.Spider): name = "wiki" start_urls = ['https://datatables.net/'] def parse(self, response): trs = response.xpath('//table[@id="example"]//tr') ...
-
如果嵌入的iframe是html,您可以抓取iframe源并从那里获取所需的表格。 library(rvest) #> Loading required package: xml2 library(magrittr) "http://www.naia.org/ViewArticle.dbml?ATCLID=205323044" %>% read_html() %>% html_nodes("iframe") %>% extract(3) %>% html_attr("src") %>% ...
-
当然,这是我的日志...... 据我所知,没有重定向发生但是那个讨厌的'='正在以某种方式结束或请求URL ...... 我现在要探索'链接处理'来解决这个问题,但是我想深入研究这个问题。 谢谢! Testing started at 10:24 AM ... pydev debugger: process 1352 is connecting Connected to pydev debugger (build 143.1919) 2016-02-17 10:24:57,789: INFO >> ...
-
我看到你在这里尝试做什么,它被称为 - 链接请求。 这意味着您希望继续产生Request并继续在Request s meta属性中携带已填充的Item 。 对于您的情况,您需要做的就是不要让Item产生一个带有Item的Request 。 将您的解析更改为: def parse(self, response): for sel in response.xpath('//table[@class]/tbody/tr'): item = SET() item['title ...