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 8302687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:20:51+00:00 2026-06-08T17:20:51+00:00

It looks like the website is blocking direct access from Curl. library(XML) library(RCurl) theurl

  • 0

It looks like the website is blocking direct access from Curl.

library(XML) 
library(RCurl) 
theurl <- "http://www.london2012.com/medals/medal-count/"
page <- getURL(theurl)

page # fail
[1] "<HTML><HEAD>\n<TITLE>Access Denied</TITLE>\n</HEAD><BODY>\n<H1>Access Denied</H1>\n \nYou don't have permission to access \"http&#58;&#47;&#47;www&#46;london2012&#46;com&#47;medals&#47;medal&#45;count&#47;\" on this server.<P>\nReference&#32;&#35;18&#46;358a503f&#46;1343590091&#46;c056ae2\n</BODY>\n</HTML>\n"

Let’s try to see if we can access it directly from the Table.

page <- readHTMLTable(theurl)

No luck there Error in htmlParse(doc) : error in creating parser for http://www.london2012.com/medals/medal-count/

How would you go about getting this table into R?


Update: in response to comments and toying, faking a user agent string worked to get the content. But readHTMLtable returns an error.

page <- getURLContent(theurl, useragent="Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20120716 Firefox/15.0a2")
  • 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-08T17:20:52+00:00Added an answer on June 8, 2026 at 5:20 pm

    It looks like this works:

    rr <- readHTMLTable(page,header=FALSE)
    rr2 <- setNames(rr[[1]],
                    c("rank","country","gold","silver","bronze","junk","total"))
    rr3 <- subset(rr2,select=-junk)
    ## oops, numbers all got turned into factors ...
    tmpf <- function(x) { as.numeric(as.character(x)) }
    rr3[,-2] <- sapply(rr3[,-2],tmpf)               
    head(rr3)
    ##   rank                                country gold silver bronze total
    ## 1    1             People's Republic of China    6      4      2    12
    ## 2    2               United States of America    3      5      3    11
    ## 3    3                                  Italy    2      3      2     7
    ## 4    4                      Republic of Korea    2      1      2     5
    ## 5    5                                 France    2      1      1     4
    ## 6    6 Democratic People's Republic  of Korea    2      0      1     3
    with(rr3,dotchart(total,country))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a URL which looks like this: http://www.website.co.uk/en-us/aboutus/thegroup/test.aspx I have a UL LI
I am getting JSON string from website. I have data which looks like this
i made a website that looks like this www.yoursdproperty.com i would like to know
I have an xml file stored on my website that looks like this: <games>
So my .htaccess file looks like this RewriteBase / Redirect 301 /page.html http://www.yoursite.com/newpage.html Redirect
I have a basic website nav layout that looks like this: <li class=folder parent_folder>
The DOM structure looks like this (existing website ... cant modify it): <table> <tr><td>
I have a website that paginate result via jquery.ajax(). URLs looks like: website.com/index.php?page=N I've
My website file structure currently looks like this: marketplace.php cats.php On marketplace.php I have
I would like to create a website that is iPhone-friendly ... that looks like

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.