I´m trying to extract a YouTube Video description using Rvest. I know that it would be easier to just use the API but the end goal is to get more familiar with Rvest, rather than just getting the Video description. This is what I did so far:
# defining website
page <- "https://www.youtube.com/watch?v=4PqdqWWSHJY"
# setting Xpath
Xp <- '/html/body/div[2]/div[4]/div/div[5]/div[2]/div[2]/div/div[2]/meta[2]'
# getting page
Website <- read_html(page)
# printing description
html_attr(Description, name = "content")
While this does point to the video description, I don't get the full video description but a character string that is cut off after a few lines:
[1] "The Conservatives and Labour have been outlining their main pitch to voters. The Prime Minister Boris Johson in his first major speech of the campaign said a..."
Expected Output would be the full description
"The Conservatives and Labour have been outlining their main pitch to voters. The Prime Minister Boris Johnson in his first major speech of the campaign said a Conservative government would unite the country and "level up" the prospects for people with massive investment in health, better infrastructure, more police, and a green revolution. But he said the key issue to solve was Brexit. Meanwhile Labour vowed to outspend the Tories on the NHS in England.
Labour leader Jeremy Corbyn has also faced questions over his position on allowing a second referendum on Scottish independence. Today at the start of a two-day tour of Scotland, he said wouldn't allow one in the first term of a Labour government but later rowed back saying it wouldn't be a priority in the early years.
Sophie Raworth presents tonight's BBC News at Ten and unravels the day's events with the BBC's political editor Laura Kuenssberg, health editor Hugh Pym and Scotland editor Sarah Smith.
Please subscribe HERE: LINK"
Is there any way of getting the full description with rvest?