This function allows to get a graph object from a certain webpage. The network_from_webpage function differs from the get_graph function due to the fact that get_graph only gets the graph for one page, and network_from_webpage gets the graph of the connected pages also.
Arguments
- target
The target file you are targeting (Usually a web adress).
- iteration
The number of iteration you want. If set to one, this function is equivalent to the "graph_from_webpage() function."
Examples
target = "https://www.google.com/"
N <- network_from_webpage1(target, iteration = 1)
#> Time for edgelist_of https://www.google.com/: 0.144283294677734 seconds.
#> Time for network_from_webpage1 : 0.144760847091675 seconds.
class(N)
#> [1] "data.frame"
dim(N)
#> [1] 17 2
N2 <- network_from_webpage1(target, iteration = 2)
#> Time for edgelist_of https://www.google.com/: 0.138895273208618 seconds.
#> Time for edgelist_of https://www.google.com/imghp?hl=en&tab=wi: 0.137899160385132 seconds.
#> Time for edgelist_of https://maps.google.com/maps?hl=en&tab=wl: 0.252537727355957 seconds.
#> Time for edgelist_of https://play.google.com/?hl=en&tab=w8: 0.853273153305054 seconds.
#> Time for edgelist_of https://www.youtube.com/?tab=w1: 0.202510833740234 seconds.
#> Time for edgelist_of https://news.google.com/?tab=wn: 0.27430272102356 seconds.
#> Time for edgelist_of https://mail.google.com/mail/?tab=wm: 0.518590211868286 seconds.
#> Time for edgelist_of https://drive.google.com/?tab=wo: 0.405637979507446 seconds.
#> Time for edgelist_of https://www.google.com/intl/en/about/products?tab=wh: 0.217908143997192 seconds.
#> Time for edgelist_of http://www.google.com/history/optout?hl=en: 0.526129007339478 seconds.
#> Time for edgelist_of https://www.google.com/preferences?hl=en: 0.0831644535064697 seconds.
#> Time for edgelist_of https://accounts.google.com/ServiceLogin?hl=en&passive=true&continue=https://www.google.com/&ec=GAZAAQ: 0.328591108322144 seconds.
#> Time for edgelist_of https://www.google.com/advanced_search?hl=en&authuser=0: 0.262585878372192 seconds.
#> Time for edgelist_of https://www.google.com/intl/en/ads/: 0.321455955505371 seconds.
#> Time for edgelist_of https://www.google.com/services/: 0.0596070289611816 seconds.
#> Time for edgelist_of https://www.google.com/intl/en/about.html: 0.184610605239868 seconds.
#> Time for edgelist_of https://www.google.com/intl/en/policies/privacy/: 0.0576629638671875 seconds.
#> Time for edgelist_of https://www.google.com/intl/en/policies/terms/: 0.0584900379180908 seconds.
#> Time for network_from_webpage1 : 4.89454984664917 seconds.
class(N2)
#> [1] "data.frame"
dim(N2)
#> [1] 714 2