I have a dataframe with a column Website_URLs
that holds website urls. Some of these urls are not working anymore, as the website is inactive. I want to loop through this website column and check all urls and create a new binary column Website_Failure
that gives a 1 if the website is not active anymore and the url produces and error message and a 0 if the website is still up and running.
Here is a test dataframe with some active and inactive urls.
structure(list(Website_URL = c("zyx.network", "antodex.com",
"apexit.finance", "0xtrade.finance", "fireants.global", "fiattoken.org"
)), class = "data.frame", row.names = c(NA, -6L))
The output here should look like this
Website_URL Website_Failure
zyx.network 0
antodex.com 1
apexit.finance 0
0xtrade.finance 1
fireants.global 0
fiattoken.org 1
Any idea how I can accomplish this?