- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
出于教育目的,我正在尝试抓取 this page逐渐与Python and lxml ,以电影名称开头。
根据我目前从 lxml 上的 Python 文档和 XPath 上的 W3Schools 中阅读的内容,这段代码应该会在列表中生成所有电影标题:
from lxml import html
import requests
page = requests.get('http://www.rottentomatoes.com/browse/dvd-top-rentals/')
tree = html.fromstring(page.text)
movies = tree.xpath('//h3[@class="movieTitle"]/text()')
print movies
基本上,它应该给我文档中任何位置的每个 h3 元素,这些元素具有属性 class
,其值为“movieTitle”。不过,在运行代码后,我只打印出一个空列表。
我不明白为什么。
我自己试过,所以我跑了:
movies = tree.xpath('//h3[@class]/text()')
print movies
好吧,这个应该返回任何具有属性类的 H3,但它返回的是这个列表:
['From RT Users Like You!', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ']
我尝试通过定位它的类值(“noSpacing center”)来定位此列表中的第一个字符串,它成功地返回了这个唯一的字符串。所以我确定我对 lxml/XPath 的工作有一些误解。谁能指出我有用的方向?提前致谢!
最佳答案
关于 http://www.rottentomatoes.com/browse/dvd-top-rentals/ 的信息不直接呈现到页面中,而是从 XMLHttpRequests 加载。
您正在寻找的 API 似乎是:
并根据所选过滤器准备查询字符串。
因此您必须向该端点发出请求(而不是您当前请求的 URL)并解析 JSON 以提取所需数据。
您应该使用“page”GET 变量来获取下一个变量。
使用 cURL + jq 的示例:
➜ ~ curl -s http://d3biamo577v4eu.cloudfront.net/api/private/v1.0/m/list/find\?page\=1\&limit\=30\&type\=dvd-top-rentals\&services\=amazon%3Bamazon_prime%3Bflixster%3Bhbo_go%3Bitunes%3Bnetflix_iw%3Bvudu\&sortBy\=popularity | jq '.results[].title'
"Inside Out"
"Vacation"
"The End Of The Tour"
"She's Funny That Way"
"Best Of Enemies"
"Before We Go"
"Pixels"
"The Gift"
"Southpaw"
"Max"
"Jurassic World"
"San Andreas"
"Paper Towns"
"Dragon Ball Z: Resurrection 'F'"
"Testament Of Youth"
"The Wolfpack"
"Z For Zachariah"
"Tomorrowland"
"Terminator Genisys"
"Dope"
"The Gallows"
"Magic Mike XXL"
"Insidious: Chapter 3"
"Me and Earl and the Dying Girl"
"Particle Fever"
"Dark Places"
"What We Did on Our Holiday"
"Avengers: Age of Ultron"
"Spy"
"Poltergeist"
Python + 请求示例:
import json
import requests
URL = "http://d3biamo577v4eu.cloudfront.net/api/private/v1.0/m/list/find?page=2&limit=30&type=dvd-top-rentals&services=amazon%3Bamazon_prime%3Bflixster%3Bhbo_go%3Bitunes%3Bnetflix_iw%3Bvudu&sortBy=popularity"
response = requests.get(URL)
for movie in response.json()['results']:
movie_id = movie.get('id', None)
title = movie.get('title', None)
synopsis = movie.get('synopsis', None).encode('utf-8')
actors = ', '.join(movie.get('actors', None)).encode('utf-8')
tomato_score = movie.get('tomatoScore', None)
popcorn_score = movie.get('popcornScore', None)
mpaaRating = movie.get('mpaaRating', None)
runtime = movie.get('runtime', None)
print "Id: {}".format(movie_id)
print "Title: {}".format(title)
print "Synopsis: {}".format(synopsis)
print "Actors: {}".format(actors)
print "Rating: {}".format(mpaaRating)
print "Runtime: {}".format(runtime)
print "Scoring:"
print "Tomato score: {}".format(tomato_score)
print "PopCorn score: {}".format(popcorn_score)
print ""
输出:
Id: 771306118
Title: Inside Out
Synopsis: Inventive, gorgeously animated, and powerfully moving, Inside Out is another outstanding addition to the Pixar library of modern animated classics.
Actors: Amy Poehler, Bill Hader, Lewis Black
Rating: PG
Runtime: 1 hr. 34 min.
Scoring:
Tomato score: 98
PopCorn score: 90
Id: 771312080
Title: Vacation
Synopsis: Borrowing a basic storyline from the film that inspired it but forgetting the charm, wit, and heart, Vacation is yet another nostalgia-driven retread that misses the mark.
Actors: Ed Helms, Christina Applegate, Leslie Mann
Rating: R
Runtime: 1 hr. 39 min.
Scoring:
Tomato score: 26
PopCorn score: 53
Id: 771411936
Title: The End Of The Tour
Synopsis: Brilliantly performed and smartly unconventional, The End of the Tour pays fitting tribute to a singular talent while offering profoundly poignant observations on the human condition.
Actors: Jesse Eisenberg, Jason Segel, Anna Chlumsky
Rating: R
Runtime: 1 hr. 45 min.
Scoring:
Tomato score: 92
PopCorn score: 88
Id: 771402562
Title: She's Funny That Way
Synopsis: She's Funny That Way is an affectionate, talent-filled throwback to screwball comedies of old -- which makes it even more frustrating that the laughs are disappointingly few and far between.
Actors: Imogen Poots, Owen Wilson, Jennifer Aniston
Rating: R
Runtime: 1 hr. 33 min.
Scoring:
Tomato score: 38
PopCorn score: 38
Id: 771412027
Title: Best Of Enemies
Synopsis: Smart, fascinating, and funny, Best of Enemies takes a penetrating -- and wildly entertaining -- look back at the dawn of pundit politics.
Actors: Dick Cavett, Gore Vidal, John Lithgow
Rating: R
Runtime: 1 hr. 27 min.
Scoring:
Tomato score: 94
PopCorn score: 94
Id: 771387770
Title: Before We Go
Synopsis: BEFORE WE GO, the directorial debut of Chris Evans, follows the journey of two strangers stuck in New York City for the night. Starting as convenient acquaintances, the two soon grow into each other's most trusted confidants when a night of unexpected adventure forces them to confront their fears and take control of their lives. (C) Radius-TWC
Actors: Alice Eve, Chris Evans, Daniel Spink
Rating: PG-13
Runtime: 1 hr. 29 min.
Scoring:
Tomato score: 25
PopCorn score: 64
Id: 771263974
Title: Pixels
Synopsis: Much like the worst arcade games from the era that inspired it, Pixels has little replay value and is hardly worth a quarter.
Actors: Adam Sandler, Peter Dinklage, Kevin James
Rating: PG-13
Runtime: 1 hr. 46 min.
Scoring:
Tomato score: 17
PopCorn score: 51
Id: 771415974
Title: The Gift
Synopsis: The Gift is wickedly smart and playfully subversive, challenging the audience's expectations while leaving them leaning on the edges of their seats.
Actors: Jason Bateman, Rebecca Hall, Joel Edgerton
Rating: R
Runtime: 1 hr. 48 min.
Scoring:
Tomato score: 93
PopCorn score: 78
Id: 771258788
Title: Southpaw
Synopsis: Jake Gyllenhaal delivers an impressively committed performance, but Southpaw beats it down with a dispiriting drama that pummels viewers with genre clichés.
Actors: Jake Gyllenhaal, Forest Whitaker, Rachel McAdams
Rating: R
Runtime: 2 hr. 3 min.
Scoring:
Tomato score: 59
PopCorn score: 79
Id: 771379965
Title: Max
Synopsis: Max has good intentions and tries to hearken back to classic family-friendly features, but its disjointed, manipulative plot overwhelms the efforts of its talented human and canine stars.
Actors: Josh Wiggins, Lauren Graham, Thomas Haden Church
Rating: PG
Runtime: 1 hr. 51 min.
Scoring:
Tomato score: 35
PopCorn score: 73
Id: 771324839
Title: Jurassic World
Synopsis: Jurassic World can't match the original for sheer inventiveness and impact, but it works in its own right as an entertaining -- and visually dazzling -- popcorn thriller.
Actors: Chris Pratt, Bryce Dallas Howard, Vincent D'Onofrio
Rating: PG-13
Runtime: 2 hr. 3 min.
Scoring:
Tomato score: 71
PopCorn score: 80
Id: 771374432
Title: San Andreas
Synopsis: San Andreas has a great cast and outstanding special effects, but amidst all the senses-shattering destruction, the movie's characters and plot prove less than structurally sound.
Actors: Dwayne "The Rock" Johnson, Carla Gugino, Alexandra Daddario
Rating: PG-13
Runtime: 1 hr. 54 min.
Scoring:
Tomato score: 50
PopCorn score: 56
Id: 771385882
Title: Paper Towns
Synopsis: Paper Towns isn't as deep or moving as it wants to be, yet it's still earnest, well-acted, and thoughtful enough to earn a place in the hearts of teen filmgoers of all ages.
Actors: Nat Wolff, Cara Delevingne, Halston Sage
Rating: PG-13
Runtime: 1 hr. 49 min.
Scoring:
Tomato score: 55
PopCorn score: 53
Id: 771419940
Title: Dragon Ball Z: Resurrection 'F'
Synopsis: Even the complete obliteration of his physical form can't stop the galaxy's most evil overlord. After years in spiritual purgatory, Frieza has been resurrected and plans to take his revenge on the Z-Fighters of Earth. Facing off against Frieza's powerful new form, and his army of 1,000 soldiers, Goku and Vegeta must reach new levels of strength in order to protect Earth from their vengeful nemesis.
Actors: Koichi Yamadera, Todd Haberkorn, Sean Schemmel
Rating: Unrated
Runtime: 1 hr. 33 min.
Scoring:
Tomato score: 75
PopCorn score: 86
Id: 771385848
Title: Testament Of Youth
Synopsis: Testament of Youth is well-acted and beautifully filmed, adding up to an enriching if not adventurous experience for fans of British period dramas.
Actors: Alicia Vikander, Kit Harington, Dominic West
Rating: PG-13
Runtime: 2 hr. 9 min.
Scoring:
Tomato score: 81
PopCorn score: 79
Id: 771412119
Title: The Wolfpack
Synopsis: Offering a unique look at modern fears and our fascination with film, The Wolfpack is a fascinating -- and ultimately haunting -- urban fable.
Actors: Visnu Angulo, Susanne Angulo, Oscar Angulo
Rating: R
Runtime: 1 hr. 20 min.
Scoring:
Tomato score: 84
PopCorn score: 73
Id: 771408592
Title: Z For Zachariah
Synopsis: Z for Zachariah wrings compelling drama out of its simplistic premise -- albeit at a pace that may test the patience of less contemplative viewers.
Actors: Chiwetel Ejiofor, Chris Pine, Margot Robbie
Rating: PG-13
Runtime: 1 hr. 35 min.
Scoring:
Tomato score: 77
PopCorn score: 47
Id: 771306778
Title: Tomorrowland
Synopsis: Ambitious and visually stunning, Tomorrowland is unfortunately weighted down by uneven storytelling.
Actors: George Clooney, Hugh Laurie, Brittany Robertson
Rating: PG
Runtime: 1 hr. 47 min.
Scoring:
Tomato score: 50
PopCorn score: 52
Id: 771359910
Title: Terminator Genisys
Synopsis: Mired in its muddled mythology, Terminator: Genisys is a lurching retread that lacks the thematic depth, conceptual intelligence, or visual thrills that launched this once-mighty franchise.
Actors: Emilia Clarke, Jason Clarke, Jai Courtney
Rating: PG-13
Runtime: 1 hr. 59 min.
Scoring:
Tomato score: 26
PopCorn score: 59
Id: 771412133
Title: Dope
Synopsis: Featuring a starmaking performance from Shameik Moore and a refreshingly original point of view from writer-director Rick Famuyiwa, Dope is smart, insightful entertainment.
Actors: Shameik Moore, Kiersey Clemons, Tony Revolori
Rating: R
Runtime: 1 hr. 55 min.
Scoring:
Tomato score: 87
PopCorn score: 85
Id: 771417481
Title: The Gallows
Synopsis: Narratively contrived and visually a mess, The Gallows sends viewers on a shaky tumble to the bottom of the found-footage horror barrel.
Actors: Cassidy Gifford, Pfeifer Brown, Ryan Shoos
Rating: R
Runtime: 1 hr. 27 min.
Scoring:
Tomato score: 16
PopCorn score: 25
Id: 771378808
Title: Magic Mike XXL
Synopsis: Magic Mike XXL has enough narrative thrust and beefy charm to deliver another helping of well-oiled entertainment, even if this sequel isn't quite as pleasurable as its predecessor.
Actors: Channing Tatum, Matt Bomer, Joe Manganiello
Rating: R
Runtime: 1 hr. 55 min.
Scoring:
Tomato score: 62
PopCorn score: 61
Id: 771375494
Title: Insidious: Chapter 3
Synopsis: Insidious: Chapter 3 isn't as terrifying as the original, although it boasts surprising thematic depth and is enlivened by another fine performance from Lin Shaye.
Actors: Dermot Mulroney, Stefanie Scott, Angus Sampson
Rating: PG-13
Runtime: 1 hr. 37 min.
Scoring:
Tomato score: 60
PopCorn score: 54
Id: 771412075
Title: Me and Earl and the Dying Girl
Synopsis: Beautifully scripted and perfectly cast, Me & Earl & the Dying Girl is a coming-of-age movie with uncommon charm and insight.
Actors: Thomas Mann, R.J. Cyler, Olivia Cooke
Rating: PG-13
Runtime: 1 hr. 44 min.
Scoring:
Tomato score: 81
PopCorn score: 88
Id: 771364355
Title: Particle Fever
Synopsis: The concepts behind its heady subject matter may fly over the heads of most viewers, but Particle Fever presents it in such a way that even the least science-inclined viewers will find themselves enraptured.
Actors: Savas Dimopoulos, Nima Arkani-Hamed, Fabiola Gianotti
Rating: Unrated
Runtime: 1 hr. 39 min.
Scoring:
Tomato score: 95
PopCorn score: 84
Id: 771362649
Title: Dark Places
Synopsis: 25 years after testifying against her brother as the person responsible for massacring her entire family, a haunted woman (Charlize Theron) is approached by a secret society that specializes in complex, unsolved cases. Nicholas Hoult, Corey Stoll, and Chloe Moretz co-star in this Mandalay Pictures thriller directed by Gilles Paquet-Brenner, and based on the novel by Gillian Flynn. ~ Jason Buchanan, Rovi
Actors: Charlize Theron, Nicholas Hoult, Corey Stoll
Rating: R
Runtime: 1 hr. 54 min.
Scoring:
Tomato score: 26
PopCorn score: 35
Id: 771357112
Title: What We Did on Our Holiday
Synopsis: Witty and well-cast, What We Did on Our Holiday injects unlikely laughs into a story dealing with dark, difficult themes.
Actors: Rosamund Pike, David Tennant, Billy Connolly
Rating: PG-13
Runtime: 1 hr. 35 min.
Scoring:
Tomato score: 73
PopCorn score: 73
Id: 771313962
Title: Avengers: Age of Ultron
Synopsis: Exuberant and eye-popping, Avengers: Age of Ultron serves as an overstuffed but mostly satisfying sequel, reuniting its predecessor's unwieldy cast with a few new additions and a worthy foe.
Actors: Robert Downey Jr., Chris Evans, Mark Ruffalo
Rating: PG-13
Runtime: 2 hr. 21 min.
Scoring:
Tomato score: 74
PopCorn score: 85
Id: 771361497
Title: Spy
Synopsis: Simultaneously broad and progressive, Spy offers further proof that Melissa McCarthy and writer-director Paul Feig bring out the best in one another -- and delivers scores of belly laughs along the way.
Actors: Melissa McCarthy, Jason Statham, Rose Byrne
Rating: R
Runtime: 1 hr. 57 min.
Scoring:
Tomato score: 93
PopCorn score: 81
Id: 770799339
Title: Poltergeist
Synopsis: Paying competent homage without adding anything of real value to the original Poltergeist, this remake proves just as ephemeral (but half as haunting) as its titular spirit.
Actors: Sam Rockwell, Rosemarie DeWitt, Kyle Catlett
Rating: PG-13
Runtime: 1 hr. 33 min.
Scoring:
Tomato score: 31
PopCorn score: 23
Id: 771370467
Title: Entourage
Synopsis: Entourage retains many elements of the HBO series, but feels less like a film than a particularly shallow, cameo-studded extended episode of the show.
Actors: Jeremy Piven, Adrian Grenier, Kevin Dillon
Rating: R
Runtime: 1 hr. 45 min.
Scoring:
Tomato score: 32
PopCorn score: 64
Id: 771412037
Title: Cop Car
Synopsis: Cop Car boasts a terrific premise and a grimly gripping opening act -- and for some viewers, that will be enough to compensate for the movie's uneven denouement.
Actors: Kevin Bacon, Shea Whigham, Camryn Manheim
Rating: R
Runtime: 1 hr. 26 min.
Scoring:
Tomato score: 79
PopCorn score: 52
Id: 771412114
Title: Unexpected
Synopsis: Unexpected proves a thoughtful and well-acted -- if somewhat mild -- look at worthy, thought-provoking themes.
Actors: Anders Holm, Cobie Smulders, Gail Bean
Rating: R
Runtime: 1 hr. 30 min.
Scoring:
Tomato score: 67
PopCorn score: 49
Id: 771356696
Title: Pitch Perfect 2
Synopsis: Pitch Perfect 2 sings in sweet comedic harmony, even if it doesn't hit quite as many high notes as its predecessor.
Actors: Anna Kendrick, Rebel Wilson, Brittany Snow
Rating: PG-13
Runtime: 1 hr. 54 min.
Scoring:
Tomato score: 66
PopCorn score: 67
Id: 771354922
Title: Furious 7
Synopsis: Serving up a fresh round of over-the-top thrills while adding unexpected dramatic heft, Furious 7 keeps the franchise moving in more ways than one.
Actors: Vin Diesel, Paul Walker, Jason Statham
Rating: PG-13
Runtime: 2 hr. 20 min.
Scoring:
Tomato score: 81
PopCorn score: 84
Id: 771270966
Title: Cinderella
Synopsis: Refreshingly traditional in a revisionist era, Kenneth Branagh's Cinderella proves Disney hasn't lost any of its old-fashioned magic.
Actors: Lily James, Cate Blanchett, Richard Madden
Rating: PG
Runtime: 1 hr. 45 min.
Scoring:
Tomato score: 85
PopCorn score: 79
Id: 771359745
Title: Love & Mercy
Synopsis: As unconventional and unwieldy as the life and legacy it honors, Love & Mercy should prove moving for Brian Wilson fans while still satisfying neophytes.
Actors: Paul Dano, Elizabeth Banks, Brett Davern
Rating: PG-13
Runtime: 2 hr.
Scoring:
Tomato score: 89
PopCorn score: 86
Id: 771378525
Title: Monkey Kingdom
Synopsis: Monkey Kingdom's breathtaking footage of primates in the wild is likely to please animal lovers of all ages.
Actors: Tina Fey
Rating: G
Runtime: 1 hr. 25 min.
Scoring:
Tomato score: 94
PopCorn score: 77
Id: 771412081
Title: The Overnight
Synopsis: Witty and unpredictable, The Overnight benefits from writer-director Patrick Brice's sure-handed touch and strong performances from a talented cast.
Actors: Adam Scott, Taylor Schilling, Jason Schwartzman
Rating: R
Runtime: 1 hr. 20 min.
Scoring:
Tomato score: 82
PopCorn score: 60
Id: 771374337
Title: Diplomacy
Synopsis: For filmgoers who value character development and smart dialogue over plot, Diplomacy yields rich, powerfully acted rewards.
Actors: André Dussollier, Niels Arestrup, Robert Stadlober
Rating: Unrated
Runtime: 1 hr. 25 min.
Scoring:
Tomato score: 93
PopCorn score: 80
Id: 771373149
Title: The Age of Adaline
Synopsis: The Age of Adaline ruminates on mortality less compellingly than similarly themed films, but is set apart by memorable performances from Blake Lively and Harrison Ford.
Actors: Blake Lively, Michiel Huisman, Harrison Ford
Rating: PG-13
Runtime: 1 hr. 49 min.
Scoring:
Tomato score: 54
PopCorn score: 67
Id: 771028170
Title: Mad Max: Fury Road
Synopsis: With exhilarating action and a surprising amount of narrative heft, Mad Max: Fury Road brings George Miller's post-apocalyptic franchise roaring vigorously back to life.
Actors: Tom Hardy, Charlize Theron, Nicholas Hoult
Rating: R
Runtime: 2 hr.
Scoring:
Tomato score: 97
PopCorn score: 87
Id: 770683518
Title: I'll See You in My Dreams
Synopsis: I'll See You in My Dreams would be worth watching even if Blythe Danner's central performance was all it had going for it, but this thoughtful drama satisfies on multiple levels.
Actors: Blythe Danner, Martin Starr, Sam Elliott
Rating: PG-13
Runtime: 1 hr. 35 min.
Scoring:
Tomato score: 94
PopCorn score: 70
Id: 771387966
Title: Good Kill
Synopsis: Thought-provoking, timely, and anchored by a strong performance from Ethan Hawke, Good Kill is a modern war movie with a troubled conscience.
Actors: Ethan Hawke, January Jones, Zoë Kravitz
Rating: R
Runtime: 1 hr. 43 min.
Scoring:
Tomato score: 76
PopCorn score: 49
Id: 771377895
Title: Dior and I
Synopsis: Dior and I will obviously appeal to fashion fans, but this beautifully tailored documentary may draw in even the least sartorially inclined.
Actors: Omar Berrada, Marion Cotillard, Anna Wintour
Rating: R
Runtime: 1 hr. 30 min.
Scoring:
Tomato score: 82
PopCorn score: 80
Id: 771387025
Title: Glen Campbell: I'll Be Me
Synopsis: The heartrendingly honest Glen Campbell: I'll Be Me offers a window into Alzheimer's that should prove powerful viewing for Campbell fans and novices alike.
Actors: Bruce Springsteen, Bill Clinton, Paul McCartney
Rating: PG
Runtime: 1 hr. 56 min.
Scoring:
Tomato score: 100
PopCorn score: 91
Id: 771378194
Title: Boulevard
Synopsis: Boulevard features a richly layered performance from Robin Williams, but that may be this dour drama's sole distinctive feature.
Actors: Robin Williams, Kathy Baker, Roberto Aguire
Rating: R
Runtime: 1 hr. 28 min.
Scoring:
Tomato score: 51
PopCorn score: 33
Id: 770804151
Title: About Elly
Synopsis: About Elly offers viewers performances as powerful as its thought-provoking ideas, and adds another strong entry to Asghar Farhadi's impressive filmography.
Actors: Golshifteh Farahani, Taraneh Alidoosti, Taraneh Alidousti
Rating: Unrated
Runtime: 1 hr. 59 min.
Scoring:
Tomato score: 97
PopCorn score: 86
关于python - 如何用 Python 和 lxml 抓取这个网页?返回空列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33482272/
如本answer所述,如果浏览器不支持 e,可以设置后备游标。 G。 光标:抓取;。我现在的问题是获取这些图像。在我的驱动器上本地搜索“.cur”只给了我系统光标,其中 grab.cur 和 grab
以下代码在计算机上运行以从 Instagram 帐户中抓取数据。当我尝试在 VPS 服务器上使用它时,我被重定向到 Instagram 登录页面,因此脚本不起作用。 为什么当我在电脑上或服务器上时,I
我在使用 Ruby 和 Mechanize 将 POST 查询传递到站点的网站上。访问站点的查询基于 firebug,如下所示 param.PrdNo=-1¶m.Type=Prop¶m
我正在尝试抓取一个具有多个页面结果的网站,例如“1、2、3、4、5...”。 每个分页号都是到另一个页面的链接,我需要抓取每个页面。 到目前为止,我想出了这个: while lien = page.l
我正在使用 HtmlAgilityPack 在 C# Asp.Net 中执行 Scraping,到目前为止,我在从多个 Web 执行 Scratch 时没有遇到问题,但是,尝试弹出以下代码时出现错误
如果我有一个 css 文件做这样的事情 #foo:after{content:"bar;} ,有没有办法用 javascript 获取 :after 的内容?获取父元素的内容只返回 #foo 元素的内
问题是这样的: 我有一个 Web 应用程序 - 一个经常更改的通知系统 - 在一系列本地计算机上运行。该应用程序每隔几秒刷新一次以显示新信息。计算机仅显示信息,没有键盘或任何输入设备。 问题是,如果与
我想制作一个程序来模拟用户浏览网站和点击链接。必须启用 Cookie 和 javascript。我已经在 python 中成功地做到了这一点,但我想把它写成一种可编译的语言(python ide 不会
我制作了这个小机器人,它通过搜索参数列表进行处理。它工作正常,直到页面上有几个结果: product_prices_euros 给出了一半为空的项目列表。因此,当我与 product_prices_c
我需要找到一个单词的匹配项,例如: 在网上找到所有单词“学习”https://www.georgetown.edu/(结果:4个字)(您可以看到它按CTRL + F并搜索) 我有我的 Python 代
有一个站点\资源提供一些一般统计信息以及搜索工具的界面。这种搜索操作成本高昂,因此我想限制频繁且连续(即自动)的搜索请求(来自人,而不是来自搜索引擎)。 我相信有很多现有的技术和框架可以执行一些情报抓
这并不是真正的抓取,我只是想在网页中找到类具有特定值的 URL。例如: 我想获取 href 值。关于如何做到这一点的任何想法?也许正则表达式?你能发布一些示例代码吗?我猜 html 抓取库,比如 B
我正在使用 scrapy。 我正在使用的网站具有无限滚动功能。 该网站有很多帖子,但我只抓取了 13 个。 如何抓取剩余的帖子? 这是我的代码: class exampleSpider(scrapy.
我正在尝试从这个 website 中抓取图像和新闻 url .我定义的标签是 root_tag=["div", {"class":"ngp_col ngp_col-bottom-gutter-2 ng
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭上个月。 Improve this ques
我在几个文件夹中有数千个 html 文件,我想从评论中提取数据并将其放入 csv 文件中。这将允许我为项目格式化和清理它。例如,我在这个文件夹中有 640 个 html 文件: D:\My Web S
我在编写用于抓取网页的实用程序时遇到了一个问题。 我正在发送 POST 请求来检索数据,我模仿我正在抓取的网络行为(根据使用 fiddler 收集的信息)。 我已经能够自动替换我的 POST 中除 V
对于 Googlebot 的 AJAX 抓取,我在我的网站中使用“_escaped_fragment_”参数。 现在我查看了 Yandex 对我网站的搜索结果。 我看到搜索结果中不存在 AJAX 响应
我正在尝试抓取网站的所有结果页面,它可以工作,但有时脚本会停止并显示此错误: 502 => Net::HTTPBadGateway for https://website.com/id/12/ --
我是一个学习网络爬虫的初学者,由于某种原因我无法爬网this地点。当我在 Chrome 中检查它时,代码看起来不错,但是当我用 BeautifulSoup 阅读它时,它不再是可刮的。汤提到“谷歌分析”
我是一名优秀的程序员,十分优秀!