⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 get_author_list.m

📁 MAP Toolbox for matlab. World map included.
💻 M
字号:
% GET_AUTHOR_LIST : This function gets the author's name and author's
% special html number in cell matrix, "list". The variable "next_page_yesorno" 
% detects whether any author exists on the current page, thats why its useful 
% whether we should search authors on this current page and next pages.
%
%  Syntax>>
%    [next_page_yesorno,list]=get_author_list(input_url)
%
%  Class of "input_url" is char array
%  Class of "next_page_yesorno" is double array
%  Class of "list" is cell array

function [next_page_yesorno,list]=get_author_list(input_url)

url_content=urlread(input_url);
author_code='<td width="200"><a href="loadAuthor.do?objectType=author&objectId=';
author_exist=findstr(url_content,author_code);

empty_author_page=isempty(author_exist);
if empty_author_page==1
    next_page_yesorno=0;
    list=[];
else
next_page_yesorno=1;
author_start=findstr(url_content,author_code)+length(author_code);
for m=1:length(author_start)
author_num='';
for i=0:200
    if url_content(author_start(m)+i)~='"'
        author_num=[author_num url_content(author_start(m)+i)];
    else
        break,end
end
author_num_cell(m)=cellstr(author_num);
author_name='';
for i=2:200
    if url_content(author_start(m)+length(author_num)+i)~='<'
        author_name=[author_name url_content(author_start(m)+length(author_num)+i)];
    else
        break,end
end
author_name=author_name_correct(author_name);
author_name_cell(m)=cellstr(author_name);


end
list=[author_name_cell' author_num_cell'];
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -