tyrone_mings icon indicating copy to clipboard operation
tyrone_mings copied to clipboard

Market Value History

Open olivermueller opened this issue 4 years ago • 4 comments

Hi,

I'm trying to extract the market value history of players. Unfortunately, the resulting data frame I get is empty.

Using the code from the README: player_page = "https://www.transfermarkt.com/tyrone-mings/profil/spieler/253677" output_dict = tm_pull(player_page, market_value_history = True, output = 'pandas') print(output_dict['market_value_history'])

I get the following result: Empty DataFrame Columns: [club, value, data_date, age, player_id] Index: []

Best, Oliver

olivermueller avatar Aug 09 '20 17:08 olivermueller

this issue almost definitely an issue with BeautifulSoup version. I faced this issue when I was setting up a new computer and getting different results to my old computer. this line works pre bs4 4.9.0 script = mv_soup.find("script", text=re.compile("Highcharts.Chart")).text however with 4.9.0 they deprecated that functionality and would need this script = mv_soup.find("script", text=re.compile("Highcharts.Chart")).string

I found it at one point going through the documentation but cannot find it right now

ian-shepherd avatar Mar 23 '21 16:03 ian-shepherd

I'm also having this issue. The referenced line above can be found on Edd Webster's page below, in case that is helpful.

https://nbviewer.jupyter.org/github/eddwebster/football_analytics/blob/master/notebooks/1_data_scraping/TransferMarkt%20Web%20Scraping.ipynb

Any chance of a fix coming to the package?

Thanks, Chris

cg86x avatar Jun 04 '21 21:06 cg86x

I too would like to be able to pull the historical market values. I've had the same issues as mentioned above. Was this something that you were able to get working @ian-shepherd @afc04 @olivermueller ? Thanks

eddwebster avatar Aug 21 '21 21:08 eddwebster

i submitted a pull request back that fixed this but didn't get any traction. Best bet is to copy the code yourself to run or downgrade bs4 version to pre 4.9.0 when they changed how js was handled. Obviously not the ideal solution but probably want you need to do. I have my own script locally I run for when I pull this information. Happy to share if useful.

ian-shepherd avatar Aug 22 '21 21:08 ian-shepherd