有些链接是用js生成的,但是你可以通过请求从这十个事件中获取所有事件数据的json格式:
import requests
params = {"pageNum": "1",
"date": "06012016",
"type": "day",
"isSearch": "false",
"pubCalId": "GRP1322"}
r = requests.get("https://apps.iu.edu/ccl-prd/events/view/page", params=params)
for ev in r.json()["events"][0]["events"]:
print ev
这给了你:
{u'groupEvent': True, u'allDay': True, u'description': u'\n\tOnline processing is not available. Drop forms should be obtained from the student's school. Completed forms must be submitted for processing at Student Central on Union.\n\n\tDates and times are subject to change without notice. See the Official Calendar for more details.\n', u'startDate': u'12:00am', u'calendarName': None, u'recurDateUtc': None, u'imageId': None, u'privateAndViewing': False, u'imageEventId': None, u'going': False, u'location': u'', u'imageCampus': u'BL', u'summary': u'Summer 2016: Withdrawal with Grade of W or F for First Six Week classes', u'recurs': False, u'id': u'13139699'}
{u'groupEvent': True, u'allDay': False, u'description': u'\r\n\tFor freshman Theodore Dreiser in 1889, Indiana University served as fertile ground for his future literary endeavors, but to him “the life of the town, the character of its people, the professors and the students, and the mechanism, politics, and social interests of the University body proper” were far more influential. For generatio', u'startDate': u'8:00am', u'calendarName': None, u'recurDateUtc': 1464796800000, u'imageId': 125740, u'privateAndViewing': False, u'imageEventId': 13147231, u'going': False, u'location': u'', u'imageCampus': u'BL', u'summary': u'Exhibit: Student Reform Movements at IU', u'recurs': True, u'id': u'13147231'}
{u'groupEvent': True, u'allDay': False, u'description': u'\r\n\tJoin us for Traditional Arts Indiana's traveling Bicentennial exhibit, Indiana Folk Arts: 200 Years of Tradition and Innovation. Before the exhibit begins its travels across Indiana, the MMWC will present it to the IU Bloomington campus and local communities. The exhibit will be on display through July 29, 2016.\r\n', u'startDate': u'9:00am', u'calendarName': None, u'recurDateUtc': 1464800400000, u'imageId': 129351, u'privateAndViewing': False, u'imageEventId': 13163465, u'going': False, u'location': u'Mathers Museum of World Cultures, 416 N. Indiana Ave, Bloomington, IN', u'imageCampus': u'BL', u'summary': u'EXHIBIT: "Indiana Folk Arts: 200 Years of Tradition and Innovation"', u'recurs': True, u'id': u'13163465'}
{u'groupEvent': True, u'allDay': False, u'description': u'\r\n\tIn 1913, Joseph Dixon visited the Tuscarora Nation, the smallest of the Haudenosaunee (Iroquois) communities, located in western New York. Dixon photographed six individuals during his visit, and those images became part of the Wanamaker Collection of Native American photographs, now housed at the Mathers Museum of World Cultures. While reviewin', u'startDate': u'9:00am', u'calendarName': None, u'recurDateUtc': 1464800400000, u'imageId': 115080, u'privateAndViewing': False, u'imageEventId': 13110443, u'going': False, u'location': u'Mathers Museum of World Cultures, 416 N Indiana Ave, Bloomington, IN 47408', u'imageCampus': u'BL', u'summary': u'EXHIBIT: "Stirring the Pot: Bringing the Wanamakers Home"', u'recurs': True, u'id': u'13110443'}
{u'groupEvent': True, u'allDay': False, u'description': u'\r\n\t"Cherokee Craft, 1973," at the Mathers Museum of World Cultures, presents a snapshot of craft production among the Eastern Band Cherokee at a key moment in both an ongoing Appalachian craft revival and the specific cultural and economic life of the Cherokee people in western North Carolina. The exhibition showcases basketry in three di', u'startDate': u'9:00am', u'calendarName': None, u'recurDateUtc': 1464800400000, u'imageId': 96460, u'privateAndViewing': False, u'imageEventId': 11744967, u'going': False, u'location': u'Mathers Museum of World Cultures, 416 N. Indiana Ave, Bloomington, IN', u'imageCampus': u'BL', u'summary': u'EXHIBIT: "Cherokee Craft, 1973"', u'recurs': True, u'id': u'11744967'}
{u'groupEvent': True, u'allDay': False, u'description': u'\r\n\t"MONSTERS!" are extraordinary or unnatural beings that challenge the predictable fabric of everyday life. This exhibition looks at monsters from around the world, discovering who they are and what purposes they serve in various cultures, as different images of monstrousness emerge from the dark recesses of human imagination. The exhibi', u'startDate': u'9:00am', u'calendarName': None, u'recurDateUtc': 1464800400000, u'imageId': 109380, u'privateAndViewing': False, u'imageEventId': 13088883, u'going': False, u'location': u'Mathers Museum of World Cultures, 416 N. Indiana Ave, Bloomington, IN', u'imageCampus': u'BL', u'summary': u'EXHIBIT: "MONSTERS!\'', u'recurs': True, u'id': u'13088883'}
{u'groupEvent': True, u'allDay': False, u'description': u'\r\n\t"Tools of Travel" features objects that people in different times and places have used to transport themselves and their belongings, exploring the technology of travel (wagon, saddle, sled, and canoe) and how it is powered (horse, camel, dog, and human). The exhibit opens March 22,2016 and will be open through December 17, 2017.\r\n', u'startDate': u'9:00am', u'calendarName': None, u'recurDateUtc': 1464800400000, u'imageId': 129348, u'privateAndViewing': False, u'imageEventId': 13146383, u'going': False, u'location': u'Mathers Museum of World Cultures, 416 N. Indiana Ave, Bloomington, IN', u'imageCampus': u'BL', u'summary': u'EXHIBIT: "Tools of Travel"', u'recurs': True, u'id': u'13146383'}
{u'groupEvent': True, u'allDay': False, u'description': u'\r\n\t"Thoughts, Things, and Theories...What Is Culture?" at the Mathers Museum of World Cultures, examines the nature of culture through the exploration of cultural traditions surrounding life stages and universal needs.\r\n\r\n\t \r\n\r\n\tFree visitor parking is available by the Indiana Avenue lobby entrance. Metered parking is available', u'startDate': u'9:00am', u'calendarName': None, u'recurDateUtc': 1464800400000, u'imageId': 76320, u'privateAndViewing': False, u'imageEventId': 10124630, u'going': False, u'location': u'Mathers Museum of World Cultures, 416 N. Indiana Ave., Bloomington, IN', u'imageCampus': u'BL', u'summary': u'EXHIBIT: "Thoughts, Things, and Theories...What Is Culture?"', u'recurs': True, u'id': u'10124630'}
{u'groupEvent': True, u'allDay': False, u'description': u'\r\n\tNew Acquisitions: African American Art\r\n\r\n\tA group of local community, university, and business leaders, headed by Donald Griffin, Jr., broker/owner of Griffin Realty, has formed a coalition to help the IU Art Museum build its collection of works by African American artists. These first acquisitions of what is hoped will become an annual endeavo', u'startDate': u'10:00am', u'calendarName': None, u'recurDateUtc': 1464804000000, u'imageId': None, u'privateAndViewing': False, u'imageEventId': None, u'going': False, u'location': u'Art Museum', u'imageCampus': u'BL', u'summary': u'New in the Galleries', u'recurs': True, u'id': u'13164911'}
{u'groupEvent': True, u'allDay': False, u'description': u'\r\n\tDavid Konisky\r\n\t\r\n\tExtreme Weather Exposure and Support for Climate Change Adaptation\r\n', u'startDate': u'12:00pm', u'calendarName': None, u'recurDateUtc': None, u'imageId': None, u'privateAndViewing': False, u'imageEventId': None, u'going': False, u'location': u'', u'imageCampus': u'BL', u'summary': u'PAPF and G&M Summer Research Workshop', u'recurs': False, u'id': u'13164381'}
点击更多或摘要标题时弹出的大部分信息都包含在json中。
获取开始时间和摘要:
for ev in r.json()["events"][0]["events"]:
print(ev["startDate"])
print ev["summary"]
这给了你:
Summer 2016: Withdrawal with Grade of W or F for First Six Week classes
8:00am
Exhibit: Student Reform Movements at IU
9:00am
EXHIBIT: "Indiana Folk Arts: 200 Years of Tradition and Innovation"
9:00am
EXHIBIT: "Stirring the Pot: Bringing the Wanamakers Home"
9:00am
EXHIBIT: "Cherokee Craft, 1973"
9:00am
EXHIBIT: "MONSTERS!'
9:00am
EXHIBIT: "Tools of Travel"
9:00am
EXHIBIT: "Thoughts, Things, and Theories...What Is Culture?"
10:00am
New in the Galleries
12:00pm
PAPF and G&M Summer Research Workshop