How can I import bref table data into Google Sheets effectively?

I’m working on getting bref table information into my Google Sheets document. Right now I’ve been using the function =IMPORTHTML(A2, "table", 1) to pull in the data.

The problem is this method only grabs the first two tables from the source. When I try to get additional tables, it doesn’t seem to work properly.

I’ve been looking at various guides online but they mention an old embed option that I can’t find anymore in the current interface. Has this feature been moved or replaced with something else?

What would be the most reliable approach to get all the table data imported correctly? I need to make sure I can access more than just the initial tables from the bref source.

IMPORTHTML struggles with complex tables, especially bref data. I’ve hit the same wall trying to pull multiple tables from sports reference sites. The function chokes on JavaScript-loaded content and poorly indexed tables.

Ditch IMPORTHTML and use IMPORTXML with xpath queries instead. Inspect the page source to find unique table identifiers. Something like =IMPORTXML(A2, "//table[@id='specific_table_id']") works way better for grabbing specific tables.

What worked for me was splitting the import across separate cells - each one targeting a different table index - then combining everything. Yeah, the embed feature got axed, but XML gives you much tighter control over your data extraction.

honestly, the easiest fix i’ve found is changing that last paramater in ur formula. instead of using 1, try 2, 3, 4, etc. to grab different tables from the same page. like =IMPORTHTML(A2, "table", 3) pulls the third table. worked for me when i was pulling bref pitching stats that weren’t showing up with the default setting.

Indeed, you’ve touched on a common issue with using bref data as the table structures can be quite unpredictable. I faced similar challenges when trying to retrieve historical stats, where trying to access data beyond the second table frequently resulted in errors or empty cells.

For a more efficient workflow, I recommend utilizing direct CSV exports, which you can often find in the share menu of the bref pages. These options save you from the complications of HTML parsing.

In case an export isn’t available, consider implementing a Google Apps Script. This allows you to automate the process, looping through various table indices while fixing formatting issues that can disrupt standard import functions. Although the initial setup requires some effort, this approach typically yields more reliable results than using IMPORTHTML.

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.