GithubHelp home page GithubHelp logo

feddelegrand7 / ralger Goto Github PK

View Code? Open in Web Editor NEW
155.0 7.0 14.0 1.03 MB

ralger makes it easy to scrape a website. Built on the shoulders of titans: rvest, xml2.

License: Other

R 100.00%
webscraping webscraper-website webcrawling dataextraction rstats r

ralger's Introduction

ralger's People

Contributors

feddelegrand7 avatar gbganalyst avatar hadley avatar imgbotapp avatar restyled-commits avatar romainfrancois avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ralger's Issues

Is it possible to download data from market.cboe.com with ralger?

Hi,

ralger looks very promising.

I was wondering whether there is any way to download data from http://markets.cboe.com/us/futures/market_statistics/historical_data/ using ralger?

I mean, let's say I want to download all links if I select "VX+VXT- Cboe Volatility Index (VX) Futures, Includes TAS" from the dropdown. I can then see a list of links grouped by year. Selecting first one really downloads the file if I do this in browser. However if I copy the link and use read.csv("http://markets.cboe.com/us/futures/market_statistics/historical_data/products/csv/VX/2021-01-20/CFE_VX_F1.csv") it fails. Is there a trick in ralger that can accomplish successful download?

> data <- read.csv("http://markets.cboe.com/us/futures/market_statistics/historical_data/products/csv/VX/2021-01-20/CFE_VX_F1.csv")
Error in file(file, "rt") : 
  cannot open the connection to 'http://markets.cboe.com/us/futures/market_statistics/historical_data/products/csv/VX/2021-01-20/CFE_VX_F1.csv'
In addition: Warning message:
In file(file, "rt") :
  cannot open URL 'http://markets.cboe.com/us/futures/market_statistics/historical_data/products/csv/VX/2021-01-20/CFE_VX_F1.csv': HTTP status was '404 Not Found'

Any other suggestions welcome (Python or whatever).

Thanks.

Writing more documentation

need to write some docs for the following functions title_scrap, paragraph_scrap, weblink_scrap within the README.Rmd. Also, need to update the description within the DESCRIPTION file.

Extract Href Attributes from Given Nodes

How can I extract the href attributes from given nodes? Is there a ralger alternative for html_attr() of rvest?

weblink_scrap() extracts all links and in some cases string filtering parameter may not be enough.

Error: Table has inconsistent number of columns. Do you want fill = TRUE?

I tried to use {ralger} to reproduce what was done at https://www.r-bloggers.com/scrape-html-table-using-rvest/.

library(ralger)
library(tidyverse)

df <- table_scrap("https://en.wikipedia.org/wiki/List_of_highest-grossing_films_in_the_United_States_and_Canada", choose = 1)

ralger::table_scrap() threw this Error: Table has inconsistent number of columns. Do you want fill = TRUE? with no useful guide to solve this for a novice.

I tried to add fill = TRUE in

table_scrap <- function (link, choose = 1, header = T, askRobot = FALSE) 
{
  if (askRobot) {
    if (paths_allowed(link) == TRUE) {
      message(green("It's ok you're allowed to scrap this web page"))
    }
    else {
      message(bgRed("WARNING: you're not allowed to scrap this web page"))
    }
  }
  table <- link %>% read_html() %>% html_table(header, fill = TRUE) %>% 
    purrr::pluck(choose)
  return(table)
}

and it works

table_scrap("https://en.wikipedia.org/wiki/List_of_highest-grossing_films_in_the_United_States_and_Canada")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.