Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8425089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:10:40+00:00 2026-06-10T04:10:40+00:00

I try to scrape a website but can’t handle this encoding issue: # putting

  • 0

I try to scrape a website but can’t handle this encoding issue:

# putting together the url:
search_str <- "allintitle:amphibian richness OR diversity"
url <- paste("http://scholar.google.at/scholar?q=",
             search_str, "&hl=en&num=100&as_sdt=1,5&as_vis=1", sep = "")

# get content and parse it:
doc <- htmlParse(url)

# encoding isssue, like here..
xpathSApply(doc, '//div[@class="gs_a"]', xmlValue)

  [1] "M Vences, M Thomas… - …  of the Royal  …, 2005 - rstb.royalsocietypublishing.org"             
  [2] "PB Pearman - Conservation Biology, 1997 - Wiley Online Library"                                     
  [3] "D Vallan - Biological Conservation, 2000 - Elsevier"                                                
  [4] "LB Buckley, W Jetz - Proceedings of the Royal  …, 2007 - rspb.royalsocietypublishing.org"         
  [5] "Mà Rodríguez, JA Belmontes, BA Hawkins - Acta Oecologica, 2005 - Elsevier"                        
  [6] "TJC Beebee - Biological Conservation, 1997 - Elsevier"                                              
  [7] "D Vallan - Journal of Tropical Ecology, 2002 - Cambridge Univ Press"                                
  [8] "MO Rödel, R Ernst - Ecotropica, 2004 - gtoe.de" 
# ...

any pointers?

> sessionInfo()
R version 2.15.1 (2012-06-22)
Platform: x86_64-pc-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=German_Austria.1252  LC_CTYPE=German_Austria.1252   
[3] LC_MONETARY=German_Austria.1252 LC_NUMERIC=C                   
[5] LC_TIME=German_Austria.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] RCurl_1.91-1.1 bitops_1.0-4.1 XML_3.9-4.1   

loaded via a namespace (and not attached):
[1] tools_2.15.1

> getOption("encoding")
[1] "native.enc"
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T04:10:41+00:00Added an answer on June 10, 2026 at 4:10 am

    This worked to some degree for me

    doc <- htmlParse(url,encoding="UTF-8")
    head(xpathSApply(doc, '//div[@class="gs_a"]', xmlValue))
    #[1] "M Vences, M Thomas… - …  of the Royal  …, 2005 - rstb.royalsocietypublishing.org"        
    #[2] "PB Pearman - Conservation Biology, 1997 - Wiley Online Library"                          
    #[3] "D Vallan - Biological Conservation, 2000 - Elsevier"                                     
    #[4] "LB Buckley, W Jetz - Proceedings of the Royal  …, 2007 - rspb.royalsocietypublishing.org"
    #[5] "MÁ Rodríguez, JA Belmontes, BA Hawkins - Acta Oecologica, 2005 - Elsevier"               
    #[6] "TJC Beebee - Biological Conservation, 1997 - Elsevier"   
    

    thou

    xpathSApply(doc, '//div[@class="gs_a"]', xmlValue)[[81]]
    

    was displaying incorrectly on my windows box for example.

    switching to Font DotumChe using GUI preferences however showed it displaying correctly so it may just be a display issue not a parsing one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to scrape the 'School Notices' from this URL http://www.isleworthsyon.hounslow.sch.uk/ I
I'm trying do scrape this website with python and lxml. Its working greate on
Try this URL: http://sharepoint.iceweb.com/sites/demo/default.aspx?wsdl (user: demo@icemail.com, pass: demo) As far as I remember this
Try this code - import java.io.StringReader; public class StringReaderTest { public static void main(String[]
Try this piece of code - public class WhitespaceTest { public static void main(String[]
try: recursive_function() except RuntimeError e: # is this a max. recursion depth exceeded exception?
Ive created a portfolio website for myself, there is a gallery which users can
I've a python 2 script to scrape data from a reddit thread, but I've
I'm trying to do an scrape a web page but in order to Post
I'm trying to scrape a large website of government records which requires a snowball

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.