Looking to import selective data 'country-wise' from specific part of website into Excel

BlackBirdSR71

New Member
Joined
Oct 15, 2018
Messages
6
I'm trying to import some data from IATA's website onto Excel (also tried same in Google Spreadsheet). I tried using XCOPY method, but this page is constantly getting updated and the spreadsheet would eventually give 'N/A' error when new information is updated.

hK9VA.png


I basically want a spreadsheet to import specific country's data into my sheet's cell(s). I am looking for it to be country-specific.

For example, I only want to import COSTA-RICA's data or CANADA's data from this website as shown below into my spreadsheet,

VLMOT.png

Following is the spreadsheet link I've uploaded as an example : IATA Restrictions - Updated
 

Some videos you may like

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

BlackBirdSR71

New Member
Joined
Oct 15, 2018
Messages
6
Okay... so I have some success. Thanks to player0

For the whole list:
Code:
=INDEX(TRANSPOSE(IMPORTXML(
 "https://www.iatatravelcentre.com/international-travel-document-news/1580226297.htm",
 "//div/div/div/div/div/div/div/div")),,1)

For country "CANADA":
Code:
=QUERY(QUERY(INDEX(TRANSPOSE(IMPORTXML(
 "https://www.iatatravelcentre.com/international-travel-document-news/1580226297.htm",
"//div/div/div/div/div/div/div/div")),,1), "limit "&
MATCH("CAYMAN ISL.", INDEX(TRANSPOSE(IMPORTXML(
"https://www.iatatravelcentre.com/international-travel-document-news/1580226297.htm",
"//div/div/div/div/div/div/div/div")),,1), 0)-
MATCH("CANADA", INDEX(TRANSPOSE(IMPORTXML(
"https://www.iatatravelcentre.com/international-travel-document-news/1580226297.htm",
"//div/div/div/div/div/div/div/div")),,1), 0)&" offset "&
MATCH("CANADA", INDEX(TRANSPOSE(IMPORTXML(
"https://www.iatatravelcentre.com/international-travel-document-news/1580226297.htm",
 "//div/div/div/div/div/div/div/div")),,1), 0)-1, 0), "where Col1 is not null", 0)

I am able to import data into Excel using Country's name. However, there seems to be slight issue. I'm only able to import country's names which have empty cell above them. Other countries with no empty cell above them give 'N/A' error.
screenshot-docs-google-com-2020-03-24-23-30-20.png


How can I fix this issue?
 

Watch MrExcel Video

Forum statistics

Threads
1,127,656
Messages
5,626,130
Members
416,162
Latest member
Ashwin Alburg

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top